Windows Server Core 版本,預設是使用CMD當作shell ,當我們進到server core時,第一件事就是執行powershell,久了之後就會想把預設shell換成powershell,省去這一個工。
使用powershell更改Registry
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name Shell -Value 'PowerShell.exe -NoExit'
改完重新啟動就生效了。
但是,預設的啟動目錄是 C:\Windows\System32 ,看了又很礙眼,所以想要把預設目錄改掉。
底下會使用建立一個新的設定檔的方式來設定預設目錄
先新建立一個profile檔
New-Item -path $profile -type file –force
再來利用記事本編輯profile
Notepad $profile
在裡面加上一行 Set-location 你要設的目錄
Set-location c:\
然後存檔就可以了
參考資料:
Windows Server Core
Powershell
借用保哥的範例:https://blog.miniasp.com/post/2021/09/02/Batch-replace-Office-365-to-Microsoft-365-License-using-PowerShell 只是保哥的例子,不是完整的範例,借這篇把內容補齊而己 安裝 AzureAD Module 系統管理員身分執行 PowerShell 命令提示字元視窗。 執行︰ Install-Module -Name AzureAD
Oct 5, 2021先到IP的組態裡幫IP設個DNS名稱 DNS 名稱標籤 (選用): 選一個可以代表這個IP功用的名字。Azure 會自動加上尾碼。 設定 ReverseFqdn。由於 UI 上並沒有提供設定的功能,所以要使用Azure Powershell來設定。 $pip = Get-AzPublicIpAddress -Name "Public的名字" -ResourceGroupName "ResourceGroup的名字" $pip.DnsSettings.ReverseFqdn = "www.domain.com." #這裡注意fqdn最後要有個. Set-AzPublicIpAddress -PublicIpAddress $pip
Sep 13, 2021啟用VM的巢狀虛擬化 注意: Guest OS 的版本要在 Windows Server build 18945 版本以上,這裡的範例是使用 Windows Server 2004的版本 在VM安裝完成後,第一步就是先啟用VM的巢狀虛擬化 以Hyper-V為例(使用powershell) Get-VM "VM的名字" | Set-VMProcessor -ExposeVirtualizationExtensions $true 各種VM啟用的方式,參考資料如下
Jul 20, 2021今天想要修改Server Core VM的IP,但是使用sconfig卻看不到我想要修改的網卡。 Microsoft (R) Windows Script Host Version 5.812 Copyright (C) Microsoft Corp. 1996-2006, 著作權所有,並保留一切權利 正在檢查系統... =============================================================================== 伺服器設定 ===============================================================================
May 25, 2021or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up