I know there's loads of examples around the net, but I'm wondering if someone knows of or has access to a basic one? Environment is 2012R2 with Exchange 2016 and just a couple of groups in AD.
Write-Host " "
Write-Host "$SAM moved to $NewOU..."
Write-Host " "
Write-Host "Copy this to the Staff members S drive: \\college.local\data\staffdata\teachers\$SAM\Documents"
Write-Host " "
write-Host "User also needs to be added to the relevant email groups"
If I wanted firstname.lastname as the SAM and lastname, firstname as the DisplayName would I do:
$SAM = $UserFirstname + "." + $UserLastName
$DisplayName = $UserLastName + "," + " " + $UserFirstName
If I wanted firstname.lastname as the SAM and lastname, firstname as the DisplayName would I do:
$SAM = $UserFirstname + "." + $UserLastName
$DisplayName = $UserLastName + "," + " " + $UserFirstName
I haven't tested it but that looks exactly right to me.
Though you could probably save a bit of code for display name and add the space after the comma, so:
$Displayname = $UserLastName + ", " + $UserFirstName
But as I've said I haven't tested this - so let us know how you get on.
The uri is the fully qualified domain name of the exchange server, so if your exchange server was 'srv-exchange' and your domain was 'college.local' then the fqdn would be 'srv-exchange.college.local'
The uri is the fully qualified domain name of the exchange server, so if your exchange server was 'srv-exchange' and your domain was 'college.local' then the fqdn would be 'srv-exchange.college.local'
You could always run it line by line in non-ise powershell and see what happens.
The first line should popup and ask for domain credentials
The second line will create the session
The third line should enter you into the session
Silly me, I had an = in front of the uri. No idea where that came from. On another error now, I need to develop this at home or on Azure a bit more I think.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.