Commands PowerShell Flashcards
Get-MsolRole
Will display all possible that are available.
Get-MsolRoleMember
display what members are part of a specific role.
Add-MsolRoleMember
Add users to a roll
Remove-MsolRoleMember
Removes user from a roll
Get-MsolUser
○ Will show you a max of 500 users anymore you would have to run “-all” command
Export-Csv
○ Can provide a list of all user and then export to a Csv file
Set-MSolUserPassword
○ Make any major password updates, eg if you have had a breach and want everybody to change their password can do so by using this command.
○ Can set multiple user passwordds at once
Import-Csv
Import modification into O365
Get-MSOLUser -UserPrincipalName | Select PasswordNeverExpires
This checks to see whether password never expires is enable.
This is for an individual user
Get-MSOLUser |UserPrincipalName, PasswordNeverExpires
This checks to see whether password never expires is enable.
This is for everyone.
Set-MsolUser -UserPrincipalName -PasswordNeverExpires $true
Sets Password to never expire. Pay attention to the”true or false” at the end.
False removes
True adds
§ Helpful for system account normal users should not really have this enabled
§ Individual account
Get-MSOLUser | Set MsolUser -PasswordNeverExpires $false
Sets Password to never expire. Pay attention to the”true or false” at the end.
This is for everyone
Get- MsolUser | Set-Msoluser - StrongPasswordRequired $false
○ This is command saying that it is isn’t requiring a strong password.
Set-MsolPasswordPolicy -ValidityPeriod 730 -NotificationDays 30
○ Used to configure the password expiration policy. The validity period can be a number between 14 and 730 and specifies the number of days the password remains valid.
○ NotificationDays argument speciedies the grace period between the time the user is first notified that the password must be changed and the password expiration date. The vaild range for this argument is 1 to 30 days.
Get MsolAccountSku
This will present a list of license types and the exact wording you will need to apply licenses to users