Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Coding output file

$
0
0

I am wanting to code an output file for the following script.  If the user is not found, I want to put the user(s) into a txt file.

$List = Import-CSV "path-location"
$Step1 = New-MsolLicenseOptions -AccountSkuId site:OFFICESUBSCRIPTION_STUDENT

foreach ($Users in $List)
{
Set-MsolUser -UserPrincipalName  $Users.Username -UsageLocation US
Set-MsolUserLicense -UserPrincipalName $Users.Username -AddLicenses "site:OFFICESUBSCRIPTION_STUDENT" -verbose -LicenseOptions $Step1
}


Viewing all articles
Browse latest Browse all 6937

Trending Articles