Winget
winget list --upgrade-available --source=winget
winget upgrade --all --accept-source-agreements --accept-package-agreements --include-unknown --disable-interactivity --force --silent
winget list --upgrade-available --source=winget
winget upgrade --all --accept-source-agreements --accept-package-agreements --include-unknown --disable-interactivity --force --silent
Lets get started by Opening up CMD as administrator and running the following:
dism /online /cleanup-image /scanhealth
Once /scanhealth is complete, run the following:
dism /online /cleanup-image /checkhealth
Now lets mount your Windows Server 2019 ISO as a drive. Take note of your mounted drive letter because you may need to change it to reflect it within this next command. Start elevated command prompt.
dism /online /cleanup-image /restorehealth /source:WIM:d:\sources\install.wim:2 /limitaccess
Hopefully all has been repaired restart your server, then run some windows updates and you should be good to go.
sfc /scannow
powershell -command "Start-Process -FilePath 'C:\Windows\system32\deviceenroller.exe' -ArgumentList '/c /AutoEnrollMDM'"
net localgroup administrators
net localgroup administrators username /delete
powershell -command "Start-Process -FilePath 'C:\Windows\system32\deviceenroller.exe' -ArgumentList '/c /AutoEnrollMDM'"
Rename-Computer -NewName "NEW-PC-NAME"
powershell -command " Rename-Computer -NewName "NEW-PC-NAME" "
Powercfg /Change standby-timeout-ac 0
net user administrator /active:yes
net user administrator n3w-p455w0rd
net user user /delete
netsh advfirewall firewall add rule name=”ICMP Allow incoming V4 echo request” protocol=icmpv4:8,any dir=in action=allow
Install-Module AzureAD
Install-Module MSOnline
Connect-MsolService
Get-MsolUser -all | select DisplayName,UserPrincipalName,@{N="MFA Status"; E={ if($_.StrongAuthenticationRequirements.Count -ne 0){ $_.StrongAuthenticationRequirements[0].State } else { 'Disabled'} } } | Export-CSV -Path C:\clientname.csv
Get-MsolUser | Select-Object * | Select DisplayName,UserPrincipalName,Licenses,WhenCreated | Export-CSV -Path C:\clientname.csv
Set-ExecutionPolicy RemoteSigned
Install-Module -Name ExchangeOnlineManagement
Connect-ExchangeOnline -UserPrincipalName [email protected]
Get-Mailbox | Get-MailboxStatistics | select DisplayName,TotalItemSize | Export-CSV -Path C:\clientname.csv