Você está na página 1de 9

This file contains all Windows PowerShell commands that appear in Global

Knowledge Custom Lab Manual for 20347A, Enabling and Managing Office 365.
Before performing the steps in the lab manual for Module 1, be sure to complete
each action in the Preparation Tasks instructions within the lab environment. When
you do, you will be given a DNS domain name of the form
labXXXXX.o365ready.com, where XXXXX is a unique five-digit number assigned to
you. Press CTRL-H within this document, and replace each instance of XXXXX with
that five-digit number.
Also, in the lab environment, you will note that you have been assigned a Company
Name of the form AdatumLODyyyyy, where yyyyy is a string of five alphanumeric
characters. Press CTRL-H within this document, and replace each instance of yyyyy
with those five alphanumeric characters.
It would be a good idea to save a copy of this file once you have customized it using
the above steps.
Also, you may find it convenient to store copies of the customized version of this file
on the desktops of each virtual machine that you will be using to run these
commands. Therefore, once you have modified and saved it, send it as an email
attachment to any email account that you can access from within a web browser.
The account named Holly@AdatumLODyyyyy.onmicrosoft.com would be a good
choice, once you have created it in the lab for Module 1. But feel free to send it to a
yahoo or gmail account, or any account that you can use to download attachments
from a web browser within the lab machines.
Once you have sent a customized version of this file as an email attachment,
download the attachment to the desktops of the virtual machines before you run
PowerShell commands on them. That will allow you very smooth, intuitive
copy/paste capabilities of these commands throughout the week, which might save
you a great deal of time.
Note: By triple-clicking anywhere on a command, it will select all text in that
command, allowing you to copy it to the clipboard. Then, simply right-clicking
within the PowerShell window will paste it. Keep in mind that Wordpad is installed
on all lab machines, while Word is installed on only some. Some students prefer
Wordpad to copy from, even when Word is available, so it is suggested that you try
each and decide which you prefer.
You are, of course, welcome to type each command in manually if you would like to
do so. However you decide to proceed, simply reach out to your instructor if you
have any trouble!

Windows PowerShell commands for Module 1:


There are no Windows PowerShell commands in the lab for Module 1.
Windows PowerShell commands for Module 2:
Connect-msolservice
New-MsolUser UserPrincipalName Catherine@LabXXXXX.o365ready.com
DisplayName Catherine Richard FirstName Catherine LastName Richard
Password Pa$$w0rd ForceChangePassword $false UsageLocation CH
New-MsolUser UserPrincipalName tameka@LabXXXXX.o365ready.com
DisplayName Tameka Reed FirstName Tameka LastName Reed Password
Pa$$w0rd ForceChangePassword $false UsageLocation CH
Get-MsolUser UnlicensedUsersOnly
Set-MsolUserLicense -UserPrincipalName Catherine@LabXXXXX.o365ready.com
AddLicenses AdatumLODyyyyy:ENTERPRISEPACK
Set-MsolUserLicense -UserPrincipalName Tameka@LabXXXXX.o365ready.com
AddLicenses AdatumLODyyyyy:ENTERPRISEPACK
Set-MsolUser -UserPrincipalName Catherine@LabXXXXX.o365ready.com
-blockcredential $true
Remove-MsolUser UserPrincipalName Catherine@LabXXXXX.o365ready.com Force
Get-MsolUser ReturnDeletedUsers
Restore-MsolUser UserPrincipalName Catherine@LabXXXXX.o365ready.com
Get-MsolUser ReturnDeletedUsers
Get-MsolUser
Set-MsolUser -UserPrincipalName Catherine@LabXXXXX.o365ready.com
-blockcredential $false
Import-Csv -Path C:\labfiles\O365Users.csv | ForEach-Object { New-MsolUser
-UserPrincipalName $_."UPN" -AlternateEmailAddresses $_."AltEmail" -FirstName
$_."FirstName" -LastName $_."LastName" -DisplayName $_."DisplayName"
-BlockCredential $False -ForceChangePassword $False -LicenseAssignment

$_."LicenseAssignment" -Password $_."Password" -PasswordNeverExpires $True


-Title $_."Title" -Department $_."Department" -Office $_."Office" -PhoneNumber
$_."PhoneNumber" -MobilePhone $_."MobilePhone" -Fax $_."Fax" -StreetAddress
$_."StreetAddress" -City $_."City" -State $_."State" -PostalCode $_."PostalCode"
-Country $_."Country" -UsageLocation $_."UsageLocation" }
Get-MsolUser
New-MsolGroup DisplayName Marketing Description Marketing department
users
$MktGrp = Get-MsolGroup | Where-Object {$_.DisplayName -eq "Marketing"}
$Catherine = Get-MsolUser | Where-Object {$_.DisplayName -eq "Catherine
Richard"}
$Tameka = Get-MsolUser | Where-Object {$_.DisplayName -eq "Tameka Reed"}
Add-MsolGroupMember -GroupObjectId $MktGrp.ObjectId -GroupMemberType "User"
-GroupMemberObjectId $Catherine.ObjectId
Add-MsolGroupMember -GroupObjectId $MktGrp.ObjectId -GroupMemberType "User"
-GroupMemberObjectId $Tameka.ObjectId
Get-MsolGroupMember -GroupObjectId $MktGrp.ObjectId
Set-MsolPasswordPolicy -DomainName AdatumLODyyyyy.onmicrosoft.com
ValidityPeriod 90 -NotificationDays 14
Set-MsolUserPassword UserPrincipalName Tameka@labXXXXX.o365ready.com
NewPassword Pa$$w0rd123
Get-MsolUser | Set-MsolUser PasswordNeverExpires $false
Add-MsolRoleMember RoleName Service Support Administrator
RoleMemberEmailAddress Sallie@LabXXXXX.o365ready.com
Add-MsolRoleMember RoleName Company Administrator
RoleMemberEmailAddress Nona@LabXXXXX.o365ready.com
$role = Get-MsolRole RoleName Service Support Administrator
Get-MsolRoleMember RoleObjectId $role.ObjectId

$role = Get-MsolRole RoleName Billing Administrator


Get-MsolRoleMember RoleObjectId $role.ObjectId
$role = Get-MsolRole RoleName Company Administrator
Get-MsolRoleMember RoleObjectId $role.ObjectId
Exit
Windows PowerShell commands for Module 3:
There are no Windows PowerShell commands in the lab for Module 3.
Windows PowerShell commands for Module 4:
Get-ADUser Filter * -Properties SamAccountName | foreach { Set-ADUser $_
-UserPrincipalName ($_.SamAccountName + @LabXXXXX.o365ready.com )}
CD C:\labfiles\
Set-ExecutionPolicy Unrestricted
.\CreateProblemUsers.ps1
$msolcred = Get-Credential
Connect-MsolService -Credential $msolcred
Set-MsolDirSyncEnabled -EnableDirSync $true Force
(Get-MsolCompanyInformation).DirectorySynchronizationEnabled
Start-ADSyncSyncCycle PolicyType Initial
Import-Module MSOnline
Connect-MsolService
Get-MsolCompanyInformation | fl LastDirSyncTime
Get-MsolUser -Search Josh
Start-ADSyncSyncCycle PolicyType Delta

Get-MsolGroup
Note that you need to replace the information between the less than / greater than
signs in the following command:
Get-MsolGroupMember GroupObjectId <ObjectID for Research group>
Get-MsolUser Search Josh
Get-MsolAccountSku
Windows PowerShell commands for Module 5:
Setup /?
setup.exe /download \\LON-CL1\Office16\AdatumConfiguration.xml
\\LON-CL1\Office16\setup.exe /configure \\LONCL1\Office16\AdatumConfiguration.xml
gpupdate /force
Windows PowerShell commands for Module 6:
$credential = Get-Credential
connect-msolservice credential $credential
$exchangeSession = New-PSSession -ConfigurationName Microsoft.Exchange
-ConnectionUri "https://outlook.office365.com/powershell-liveid/" -Credential
$credential -Authentication "Basic" AllowRedirection
Import-PSSession $exchangeSession DisableNameChecking
Get-AcceptedDomain
New-Mailbox -Name "Conference Room" Room
Set-CalendarProcessing "Conference Room" -AutomateProcessing AutoAccept
New-Mailbox -Name "Demonstration Laptop Equipment
Set-CalendarProcessing "Demonstration Laptop -AutomateProcessing AutoAccept

Set-mailbox Conference room resourcecapacity 25


CD C:\Labfiles
Import-Csv .\Externalcontacts.csv | %{New-MailContact -Name $_.Name
-DisplayName $_.Name -ExternalEmailAddress $_.ExternalEmailAddress -FirstName
$_.FirstName -LastName $_.LastName}
$Contacts = Import-CSV .\externalcontacts.csv
$contacts | ForEach {Set-Contact $_.Name -StreetAddress $_.StreetAddress -City
$_.City -StateorProvince $_.StateorProvince -PostalCode $_.PostalCode -Phone
$_.Phone -MobilePhone $_.MobilePhone -Pager $_.Pager -HomePhone $_.HomePhone
-Company $_.Company -Title $_.Title -OtherTelephone $_.OtherTelephone
-Department $_.Department -Fax $_.Fax -Initials $_.Initials -Notes $_.Notes -Office
$_.Office -Manager $_.Manager}
Enable-OrganizationCustomization
New-RoleGroup Name BranchOfficeAdmins roles Mail Recipients, Distribution
Groups, Move Mailboxes, Mail Recipient Creation
Add-RoleGroupMember "BranchOfficeAdmins" -Member Martina
Get-RoleGroupMember "BranchOfficeAdmins"
New-RoleAssignmentPolicy "Limited Mailbox Configuration" -Roles MyBaseOptions,
MyAddressInformation, MyDisplayName
Set-RoleAssignmentPolicy "Limited Mailbox Configuration" IsDefault
Windows PowerShell commands for Module 7:
$cred=Get-Credential
$Session=New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri
https://outlook.office365.com/powershell-liveid/ -Credential $cred -Authentication
Basic AllowRedirection
Import-PSSession $Session
Windows PowerShell commands for Module 8:
$cred = Get-Credential

$SfBSession = New-CSOnlineSession Credential $cred


Import-PSSession $SfBSession
Set-CsBroadcastMeetingConfiguration EnableBroadcastMeeting $True
Get-CsBroadcastMeetingConfiguration
Set-CSPrivacyConfiguration -EnablePrivacyMode $True
Set-CSPushNotificationConfiguration -EnableApplePushNotification $False
Get-CSPrivacyConfiguration
Get-CSPushNotificationConfiguration
Set-CsTenantFederationConfiguration AllowPublicUsers $True
Set-CsTenantFederationConfiguration AllowFederatedUsers $True
$AllDomains = New-CsEdgeAllowAllKnownDomains
$BlockedDomain = New-CsEdgeDomainPattern -Domain "litware.com"
Set-CsTenantFederationConfiguration -AllowedDomains $AllDomains
BlockedDomains $BlockedDomain
Get-CsTenantFederationConfiguration
Get-CsMeetingConfiguration
Windows PowerShell commands for Module 9:
Connect-SPOService Url https://AdatumLODyyyyy-admin.sharepoint.com
credential holly@LabXXXXX.o365ready.com
New-SPOSite -Url https://AdatumLODyyyyy.sharepoint.com/sites/AcctsProj -Owner
holly@LabXXXXX.o365ready.com -StorageQuota 500 -NoWait -Template
PROJECTSITE#0 Title Accounts Project
Windows PowerShell commands for Module 10:
$cred = Get-Credential

$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri


https://outlook.office365.com/powershell-liveid/ -Credential $cred -Authentication
Basic AllowRedirection
Import-PSSession $Session AllowClobber
New-UnifiedGroup DisplayName "Planning Group" -Alias "PlanningGroup"
EmailAddresses PlanningGroup@LabXXXXX.o365ready.com
Add-UnifiedGroupLinks "Planning Group" Links Holly@labXXXXX.o365ready.com
LinkType Owner
Add-UnifiedGroupLinks "Planning Group" Links
Francisco@labXXXXX.o365ready.com LinkType Member
Windows PowerShell commands for Module 11:
$Cred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri
https://outlook.office365.com/powershell-liveid/ -Credential $Cred -Authentication
Basic AllowRedirection
Import-PSSession $Session
Set-IRMConfiguration -RMSOnlineKeySharingLocation https://sprms.eu.aadrm.com/TenantManagement/ServicePartner.svc
Import-RMSTrustedPublishingDomain -RMSOnline -name "RMS Online"
Set-IRMConfiguration -InternalLicensingEnabled $true
Test-IRMConfiguration -Sender holly@labXXXXX.o365ready.com
Remove-PSSession $Session
Windows PowerShell commands for Module 12:
There are no Windows PowerShell commands in the lab for Module 12.
Windows PowerShell commands for Module 13:
Add-KdsRootKey EffectiveTime ((get-date).addhours(-10))

Set-ExecutionPolicy Unrestricted force


Import-Module MSOnline
$msolcred = Get-Credential
Connect-MsolService -Credential $msolcred
Get-MsolDomain
Convert-MsolDomainToFederated -DomainName LabXXXXX.o365ready.com
Get-MsolFederationProperty -DomainName LabXXXXX.o365ready.com

Você também pode gostar