Category: Powershell
Connect-MsolService fails with MFA authentication
I was getting a legacy password prompt with the command Connect-MsolService As per some suggestions…
Useful Powershell commands for Windows
To Restart a remote PC Restart-Computer -ComputerName name -Force
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
Powershell how to read a csv file
Here is how we can get information in a csv file format using Export-CSV command.…
Stop Windows Defender Service on Windows 10
Open powershell as administrator Set-MpPreference -DisableRealtimeMonitoring $true Set-MpPreference -DisableRealtimeMonitoring $false For more information https://superuser.com/questions/1046297/how-do-i-turn-off-windows-defender-from-the-command-line
Get Users with a specific Office 365 License
Sometimes we need to get users with a specific Get-MsolUser -MaxResults 15000 | Where-Object {($_.licenses).AccountSkuId…
Useful Powershell commands for Active Directory
> Get-ADComputer -SearchBase "OU=OU1,OU=OU2,OU=OU3,DC=domain,DC=com" -Filter * -Prop erties * | Select -Property Name,Enabled,LastLogonDate | Export-CSV…
Useful PowerShell Commands for Office 365 Administration
Users Get-MsolUser -UserPrincipalName xxxx Groups Get-Group -Identity xxxx Get-DistributionGroup -Identity xxxx Remove-UnifiedGroup -Identity Set-DistributionGroup –Identity…