Windows – Rename Computer

PowerShell $(gwmi win32_computersystem).Rename(“PC-NewName”) Rename-Computer -NewName PC-NewName -Restart Invoke-command -computer PC-OldName -script {rename-computer PC-NewName; restart-computer} Commands WMIC ComputerSystem where Name=”PC-NewName” call Rename Name=NewName netdom renamecomputer %computername% /newname:PC-NewName /userd:domain\adminaccount /passwordd:password /reboot:10   Notes Rename-Computer Invoke-Command Netdom.exe WMIC.exe Get-WmiObject (gwmi)

Windows 10 – Freeze a Windows Build Version

This is how you lock the Windows build version—meaning this will prevent a future release from being automatically applied. Useful for gaining control over the build versions in your fleet. Enable reg add “HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate” /v TargetReleaseVersion /t REG_DWORD /d 1 /f /reg:64 Set Version reg add “HKLM\SOFTWARE\Policies\M9icrosoft\Windows\WindowsUpdate” /v TargetReleaseVersionInfo /t REG_SZ /d 2004 /f /reg:64 Read More …

PowerShell – Create Zip and Backup File

  Notes Add-Type Join-Path Copy-Item Test-Path Remove-Item io.compression.zipfile Get Basic Details of a Loaded Assembly [appdomain]::currentdomain.GetAssemblies() | Where-Object Location -match ‘mscorlib’ Discover The Types/Classes Inside a Given Assembly ([appdomain]::currentdomain.GetAssemblies() | Where-Object Location -Match ‘mscorlib’).gettypes() To Discover the Members Within a Class (([appdomain]::currentdomain.GetAssemblies() | Where-Object location -match ‘mscorlib’).gettypes() | Where-Object name -eq ‘string’).getmembers() | Format-Table name, Read More …