Quantcast
Channel: Azure Active Directory forum
Viewing all articles
Browse latest Browse all 16000

PowerShell - ForEach

$
0
0

I am writing some powershell foreach loops and wanted to make sure that I had this portion of the command understood:

if I set a variable such as $List $List = Get-mailbox

and then I create a foreach loop like so

ForEach($NewUser in $NewUsers){New-MsolUser –UserPrincipalName $NewUser.UserPrincipalName –DisplayName $NewUser.DisplayName –FirstName $NewUser.Firstname –LastName $NewUser.LastName –Password $NewUser.Password –Department $NewUser.Department –UsageLocation $NewUser.UsageLocation –LicenseAssignment $Sku.AccountSkuId}

I am confused on this part of the command ForEach($NewUser << in $NewUsers)

The $NewUser is not defined anywhere? I think I have it understood but would like to know if some can help clear up my confusions.

Thanks,

Robert


Robert


Viewing all articles
Browse latest Browse all 16000

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>