This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Rename-Computer -ComputerName "Srv01" -NewName "Server001" -LocalCredential Srv01\Admin01 -DomainCredential Domain01\Admin01 -Force -PassThru -Restart | |
| <# | |
| 1. Use -LocalCredential when: The computer is not joined to a domain yet (workgroup machine), or you are renaming it before joining it to a domain. | |
| 2. Use -DomainCredential when: The computer is already domain-joined and you are renaming it while it’s on the domain. | |
| 3. Use both -LocalCredential and -DomainCredential when: The computer is domain-joined, but you don’t currently have a session with domain rights to the remote system meaning: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $namesList = @( | |
| "[PC-NAME]", | |
| "[PC-NAME]", | |
| "[PC-NAME]", | |
| ) | |
| foreach ($name in $namesList) { | |
| Enter-PSSession -ComputerName $name | |
| gpupdate /force | |
| # Install-Module -Name PSWindowsUpdate -Force |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $namesList = @( | |
| "[PC-NAME]", | |
| "[PC-NAME]", | |
| "[PC-NAME]", | |
| ) | |
| foreach ($name in $namesList) { | |
| shutdown /r /m \\$name /t 0 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| How to access another Windows computer's file explorer from file explorer: | |
| \\ComputerName\C$ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Add-LocalGroupMember -Group "Administrators" -Member "DomainName\UserName" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Get-PhysicalDisk | Select-Object DeviceID,FriendlyName,MediaType,BusType,@{Name='Size(GB)';Expression={"{0:N1}" -f ($_.Size/1GB)}} | Format-Table -AutoSize | |
| Get-Partition | Format-Table -AutoSize |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Enter-PSSession -ComputerName <RemoteComputerName> -Credential (Get-Credential) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| Invoke-Command -ComputerName REMOTEPC -ScriptBlock { | |
| Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object Name, Manufacturer, Model | |
| Get-CimInstance -ClassName Win32_BIOS | Select-Object -ExpandProperty SerialNumber | |
| } | |
| #> | |
| Invoke-Command -ComputerName REMOTEPC -ScriptBlock { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Invoke-Command -ComputerName <RemoteComputerName> -ScriptBlock { | |
| Import-Module PSWindowsUpdate | |
| Get-WindowsUpdate -AcceptAll -Install -AutoReboot | Out-File C:\Windows\PSWindowsUpdate.log | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Enter-PSSession -ComputerName <servername> | |
| gpupdate /force | |
| # Install-Module -Name PSWindowsUpdate -Force | |
| Import-Module PSWindowsUpdate | |
| Get-WindowsUpdate | |
| Install-WindowsUpdate -AcceptAll -AutoReboot | |
| # Restart-Computer -Force |
NewerOlder