jenna lyday. establish a credential all of the bpos tasks require authentication. rather than...

15
USING POWERSHELL WITH BPOS Jenna Lyday

Upload: abner-butler

Post on 11-Jan-2016

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Jenna Lyday. Establish a Credential  All of the BPOS tasks require authentication. Rather than typing in a user name and password for each task, put

USING POWERSHELL WITH BPOS

Jenna Lyday

Page 2: Jenna Lyday. Establish a Credential  All of the BPOS tasks require authentication. Rather than typing in a user name and password for each task, put

Establish a Credential

All of the BPOS tasks require authentication. Rather than typing in a user name and password for each task, put it into a variable.

$cred = get-credential

Page 3: Jenna Lyday. Establish a Credential  All of the BPOS tasks require authentication. Rather than typing in a user name and password for each task, put

Get a List of Disabled Users Get-MSOnlineUser supports the default

MOAC views. If you are expecting a list of more than 250 objects, be sure to specify ResultSize

Get-MSOnlineUser -Credential $cred -Disabled |ft DisplayName, Identity

Trusty

Crede

ntial

Format results as a

table for easy viewing

Page 4: Jenna Lyday. Establish a Credential  All of the BPOS tasks require authentication. Rather than typing in a user name and password for each task, put

Get-MSOnlineUser Returns a single user or a single user view Returns the following properties for each user returned:

First Name Last Name User Principal Name Display Name Job Title Department Office Number Office Phone Mobile Phone Fax Number Street Address City State or Province ZIP or Postal code Country or Region Proxy Addresses Password Expiration Date Last Sign In Mailbox Size (used) Mailbox Size (allocated) IsActive CreatedDate SubscriptionIDs

Page 5: Jenna Lyday. Establish a Credential  All of the BPOS tasks require authentication. Rather than typing in a user name and password for each task, put

Get a List of Active Subscriptions (and put them into a variable)

By default, only active subscriptions are returned

Use –DisplayAll to see all subscriptions regardless of state

$sub = Get-MSOnlineSubscription -Credential $cred

Page 6: Jenna Lyday. Establish a Credential  All of the BPOS tasks require authentication. Rather than typing in a user name and password for each task, put

Put Subscription Information Into a CSV

Variables aren’t portable between sessions, so you’ll want a file

Get-MSOnlineSubscription -Credential $cred |select-object -property subscriptionid,Status,ExchangeStorage,SharepointStorage,totalseats,usedseats,createdtime |export-csv out.csv

Filters

the object

properties

Creates

output file

Page 7: Jenna Lyday. Establish a Credential  All of the BPOS tasks require authentication. Rather than typing in a user name and password for each task, put

Enable a Single User

We’re leveraging $sub, but you can paste the GUID of the subscription in directly as well.

Grant seats in multiple subscriptions with a comma separated list of GUIDs

Enable-MSOnlineUser -Identity [email protected] -Credential $cred -SubscriptionIds $sub.SubscriptionId -Password 'P@ssw0rd'-UserLocation us

Page 8: Jenna Lyday. Establish a Credential  All of the BPOS tasks require authentication. Rather than typing in a user name and password for each task, put

Enable a Batch of Users

Optimal method for performance

CSV format:Identity,SubscriptionIds,Password,[email protected],aa9713dd-baeb-464f-8c0c-fd48bd12dbd3,P@ssw0rd,[email protected],aa9713dd-baeb-464f-8c0c-fd48bd12dbd3,P@ssw0rd,[email protected],aa9713dd-baeb-464f-8c0c-fd48bd12dbd3,P@ssw0rd,us

Import-Csv .\input.csv |Enable-MSOnlineUser -Credential $cred

Page 9: Jenna Lyday. Establish a Credential  All of the BPOS tasks require authentication. Rather than typing in a user name and password for each task, put

Set a Password

Can specify not to change on next logon Can set password to one previously

used. Complexity requirements enforced

Set-MSOnlineUserPassword -Credential $cred -Identity [email protected] -Password P@ssw0rd1 -ChangePasswordOnNextLogon false

Page 10: Jenna Lyday. Establish a Credential  All of the BPOS tasks require authentication. Rather than typing in a user name and password for each task, put

Get Mailbox Metadata

This is information about the mailbox Works against any Exchange 2007 mailbox

$mbx = Get-XsHostedExchangeMailbox -SourceServer red001.mail.microsoftonline.com -SourceIdentity [email protected] -SourceAdminCredential $cred -SourceDetail full

Page 11: Jenna Lyday. Establish a Credential  All of the BPOS tasks require authentication. Rather than typing in a user name and password for each task, put

Display Folder Item Count For the Mailbox Many mailboxes will be smaller on the

target than on the source This assists with verifying that item

counts match

$mbx.folders |ft DisplayName,ItemCount

Page 12: Jenna Lyday. Establish a Credential  All of the BPOS tasks require authentication. Rather than typing in a user name and password for each task, put

Grant FullMailboxAccess Other permissions supported with this

command are SendAs and SendOnBehalfOf SendOnBehalfOf establishes the TrustedUser

as a mailbox Delegate with default Outlook permissions

Add-MSOnlineMailPermission -Credential $cred -Identity [email protected] -TrustedUser [email protected] -GrantFullAccess true

Page 13: Jenna Lyday. Establish a Credential  All of the BPOS tasks require authentication. Rather than typing in a user name and password for each task, put

Get a specific mail item from a mailbox Migration logs use MessageID as the

unique name for the item with the error. To extract that message for

troubleshooting, do the following:

Get-XsHostedExchangeMailboxData -SourceServer red001.mail.microsoftonline.com -Identity [email protected] -SourceAdminCredential $cred -SourceItemIdentity AQEAAQPvLyasAAAAAAAAAAAAAAAA Sample

messageID

Page 14: Jenna Lyday. Establish a Credential  All of the BPOS tasks require authentication. Rather than typing in a user name and password for each task, put

Export content to a tbin

TBins make PowerShell objects portable from one session of the migration tools to another

Get-XsHostedExchangeMailboxData -SourceServer red001.mail.microsoftonline.com -Identity [email protected] -SourceAdminCredential $cred -SourceItemIdentity AQEAAQPvLyasAAAAAAAAAAAAAAAA|Export-TransporterBinary -TargetFilePrefix tbin -TargetFilePath c:\temp

Page 15: Jenna Lyday. Establish a Credential  All of the BPOS tasks require authentication. Rather than typing in a user name and password for each task, put

Import from a TBin

Having data portable between two sessions is only useful if you can not only export it but import it

Import-TransporterBinary -SourceFileName c:\temp\tbin.tbin File we created

in last slide