Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Powershell Scripts ====== Please share your most commonly used Powershell Scripts here === Disable Clutter from all users === <file powershell>Get-Mailbox | Set-Clutter -Enable $false</file> === Share all user calendars with one user === <file powershell>Get-Mailbox | ForEach-Object {$a=$_.identity; $a+”:\calendar”} | ForEach-Object {$a; Add-MailboxFolderPermission -Identity $a -User “username” -AccessRights PublishingAuthor}</file> === Show list of users connecting with a mobile device === <file powershell>Get-MobileDevice | Select -Property DeviceType,DeviceUserAgent,Identity</file> === Show the device ID of the mobile devices for requested user === <file powershell>Get-MobileDevice -mailbox %username% | Format-List Identity</file> === Remote wipe a device === <file powershell>Clear-MobileDevice –Identity DEVICEID –NotificationEmailAddresses emailaddress@domain.com</file> for example: <file powershell>Clear-MobileDevice –Identity "Bob Smith\ExchangeActiveSyncDevices\iPhone§GD4N05JLQ99VDR8NGKIN4VAI0C" –NotificationEmailAddresses emailaddress@domain.com</file> === Remove a mobile device from list of devices === <file powershell>Remove-MobileDevice –Identity DEVICEID</file> for example: <file powershell>Remove-MobileDevice –Identity "Bob Smith\ExchangeActiveSyncDevices\iPhone§GD4N05JLQ99VDR8NGKIN4VAI0C"</file> === Display users who have forwarding enabled and show addresses === <file powershell Get-FowardingAddress.ps1> Get-Mailbox | Where {($_.ForwardingSMTPAddress -ne $null) -or ($_.ForwardingAddress -ne $null)} | Select Name, ForwardingSMTPAddress, ForwardingAddress, DeliverToMailboxAndForward </file> === Display versions of Outlook connecting to Office 365 === <file powershell Get-OutlookVersion.ps1> Get-Mailbox | Set-Mailbox -AuditOwner MailboxLogin -AuditEnabled $true Get-Mailbox | Search-MailboxAuditLog -LogonTypes owner -ShowDetails | ? { $_.ClientInfoString -like "*Outlook*" } | select MailboxOwnerUPN,Operation,LogonType,LastAccessed,ClientInfoString | export-csv .\OutlookConnections.csv </file> === Deploy Office 365 and/or Remove Previous Versions of Office === https://github.com/OfficeDev/Office-IT-Pro-Deployment-Scripts https://github.com/OfficeDev/Office-IT-Pro-Deployment-Scripts/tree/master/Office-ProPlus-Deployment/Remove-PreviousOfficeInstalls CKG Edit Last modified: 2018/02/25 01:18by 127.0.0.1