Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Connect to 365
- Set-ExecutionPolicy RemoteSigned
- // Hit S and enter
- $UserCredential = Get-Credential
- // Type in admin credentials
- $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
- Import-PSSession $Session
- // When finished make sure you enter: Remove-PSSession $Session
- Connect to 365 (MFA)
- Connect-EXOPSSession -UserPrincipalName snadmin@
- Add/Remove Full Access Rights to Mailbox:
- $UserCredential = Get-Credential
- $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
- Import-PSSession $Session
- Add-MailboxPermission TARGETMAILBOX@TENANT.com -User USERGETTINGPERMISSION@TENANT.com -AccessRights FullAccess -AutoMapping $false
- Remove Full Access Rights to Mailbox:
- $UserCredential = Get-Credential
- $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
- Import-PSSession $Session
- Remove-MailboxPermission deirdre@maffeilandscape.com -User Awarchal@maffeilandscape.com -AccessRights FullAccess
- Convert to shared mailbox
- Set-Mailbox xxxx@yyyy.onmicrosoft.com -Type shared
- Sync AD
- Start-ADSyncSyncCycle -PolicyType Delta
- // This is a quick sync that should work for most tasks
- Start-ADSyncSyncCycle -PolicyType Initial
- // This is a more in-depth sync which takes longer but is more thorough, you shouldn’t need to use this unless troubleshooting why a Delta sync is not working
- Change UPN (Sign In Address)
- Connect-MsolService
- Set-MsolUserPrincipalName -UserPrincipalName "snadmin@capecdp.onmicrosoft.com" -NewUserPrincipalName "snadmin@capecdp.com"
- Change Password
- Connect-MsolService
- Set-MsolUserPassword -UserPrincipalName admin@TENANT.com -NewPassword NEWPASSWORD -ForceChangePassword $False
- Enable AD Sync Scheduling
- Set-ADSyncScheduler -SchedulerSuspended $false
- Generate List of Admins
- $cred = Get-Credential
- Connect-MsolService -credential $cred
- $role = Get-MsolRole -RoleName "Company Administrator"
- Get-MsolRoleMember -RoleObjectId $role.ObjectId | Export-CSV c:\admin list.csv
- Increase Mailbox Size
- Set-Mailbox < UserID > -ProhibitSendQuota < Value > -ProhibitSendReceiveQuota < Value > -IssueWarningQuota <Value>
- Set-Mailbox orders@microc.com -ProhibitSendQuota 49GB -ProhibitSendReceiveQuota 50GB -IssueWarningQuota 48GB
- Create Encrypted Password File
- ConvertFrom-SecureString | Out-File "c:\powershell\password.key"
- Change Password - Automated
- $TenantUname = "admin@TENANT.com"
- $TenantPass = cat "c:\powershell\password.key" | ConvertTo-SecureString
- $TenantCredentials = new-object -typename System.Management.Automation.PSCredential -argumentlist $TenantUname, $TenantPass
- Connect-MsolService -Credential $TenantCredentials
- Set-MsolUserPassword -UserPrincipalName "test123@TENANT.com" -NewPassword "Bovine34" -ForceChangePassword $False
- Set-MsolUser -UserPrincipalName test123@TENANT.com -PasswordNeverExpires $true
- List All Email Addresses and Aliases
- Set-ExecutionPolicy RemoteSigned
- // Hit S and enter
- $UserCredential = Get-Credential
- // Type in admin credentials
- $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
- Import-PSSession $Session
- get-mailbox | select -expand emailaddresses alias
- // This will generate a giant list, copy and paste it into a notepad or something and then use ctrl F to find the alias you’re looking for
- Set Conference Room Calendar Permissions
- $LiveCred = Get-Credential
- $Session = New-PSSession -ConfigurationName Microsoft.Exchange-ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
- Import-PSSession $Session
- Set-MailboxFolderPermission -Identity "room@comain.com:\Calendar" -User default -AccessRights PublishingAuthor
- Modern Authentication
- Set-ExecutionPolicy RemoteSigned
- // Hit S and enter
- $UserCredential = Get-Credential
- // Type in admin credentials
- $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
- Import-PSSession $Session
- // Check Status
- Get-OrganizationConfig | Format-Table Name,OAuth* -Auto
- // Turn on
- Set-OrganizationConfig -OAuth2ClientProfileEnabled $true
- // Turn off
- Set-OrganizationConfig -OAuth2ClientProfileEnabled $false
- Create RMS Templates Manually
- $irmConfig = Get-IRMConfiguration
- $list = $irmConfig.LicensingLocation
- if (!$list) { $list = @() }
- if (!$list.Contains($licenseUri)) { $list += $licenseUri }
- Set-IRMConfiguration -AzureRMSLicensingEnabled $true -InternalLicensingEnabled $true
- Set-IRMConfiguration -SimplifiedClientAccessEnabled $true
- // To Test
- Test-IRMConfiguration -Sender "xxxx@tenant.com"
- Adopt Ubiquiti
- set-inform http://wifi.securebiznetworks.com:8080/inform
- http://wifi.securebiznetworks.com:8080/inform
- set-inform http://unifi.securebiznetworks.com:8080/inform
- http://unifi.securebiznetworks.com:8080/inform
- OpenDNS Fix
- reg add "HKEY_LOCAL_MACHINE\SOFTWARE\POLICIES\MICROSOFT\Windows\NetworkConnectivityStatusIndicator" /v UseGlobalDNS /t REG_DWORD /d 1 /f
- Refresh Webroot From CMD
- 32-bit
- "C:\Program Files\Webroot\WRSA.exe" -poll
- 64-bit
- "C:\Program Files (x86)\Webroot\WRSA.exe" -poll
- Change MFA Options
- https://aka.ms/mysecurityinfo
- Set Password to Never Expire
- WMIC USERACCOUNT WHERE Name='pam' SET PasswordExpires=FALSE
- Clear All Inbox Rules on Mailbox
- Get-InboxRule -Mailbox "BrianBarth@CCB-Media.com"| Remove-InboxRule
- View Calendar Permissions of User
- Get-MailboxFolderPermission <UPN of Calendar Owner>:\calendar
- Add Calendar Permissions of User
- Add-MailboxFolderPermission -Identity <UPN of Calendar Owner>:\calendar -user <UPN of User Gaining Access> -AccessRights <Permission Level, such as PublishingEditor>
- Change Calendar Permissions of User
- Set-MailboxFolderPermission -Identity <UPN of Calendar Owner>:\calendar -user <UPN of User Gaining Access> -AccessRights <Permission Level, such as PublishingEditor>
- Never Use Rich Text Format
- Set-RemoteDomain Default -TNEFEnabled $false
- Initiate Online Archiving Process
- Start-ManagedFolderAssistant –Identity <UserName>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement