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
§ Set-MsolUserLicense -UserPrincipalName -AddLicenses
Add licenses to bulk imported users
§ Get-MSolUser -UnLicensedUsersOnly | Set-MsolUserLicense-AddLicenses
Add licenses to bulk imported users
Get-MsolUser -ReturnDeletedusers
Returns all soft deleted users.
Get-MsolUser -ReturnDeletedUsers | Remove-MsolUser -RemoveFromRecycleBin -Force
Hard deletes a user.
Add-AadrmRoleBasedAdministrator
cmdlet cam be used to assign either global administration permission over Azure Rights Management (RMS) or permission to install and RMS connector. A user or group granted global admin permission can run any Azure RMS cmdlet and configure RMS through Azure management protal or office 365 admin.
Add-AadrmSuperUser
cmdlet is used to assign super user permission to a user. A super user can decrypt protected files and remove RMS protection. You must enable the super user feature before you can add a super user account. Can be enable with the following cmdlet Enable-AadrmSuperUserFeature.
Enable-AadrmSuperUserFeature.
Enables SuperUserFeature which need to be done before you add a super user account.