> Get-ADComputer -SearchBase “OU=OU1,OU=OU2,OU=OU3,DC=domain,DC=com” -Filter * -Prop
erties * | Select -Property Name,Enabled,LastLogonDate | Export-CSV “C:\temp\AllComputers.csv” -NoTypeInformation -Encoding UTF8
Useful Powershell commands for Active Directory
Related Posts:-
hanif.sajid@gmail.com
0 comments
Connect-MsolService fails with MFA authentication
I was getting a legacy password prompt with the command…
hanif.sajid@gmail.com
0 comments
Useful Powershell commands for Windows
To Restart a remote PC Restart-Computer -ComputerName name -Force
hanif.sajid@gmail.com
0 comments
Install Windows Updates on Windows 10 PC through Powershell
These three commands are needed to install Windows updates through Powershell, This is a quick method compared to going through the graphical interface. > Install-Module PSWindowsUpdate > Get-WindowsUpdate > Install-WindowsUpdate
