1
I have a list of employees who need skype access, and Im looking to run a create user script from this list, but only have it run on people who do not have msRTCSIP-UserEnabled as a null value.
The following will show me if msRTCSIP-UserEnabled is present / True
get-aduser -identity $username -Properties msRTCSIP-UserEnabled
I need to use the value as a conditional in something like
foreach($username in $userlist)
{
if (get-aduser -identity $username -Properties msRTCSIP-UserEnabled -eq $null)
{Run user creation / output script}
else
{continue to next $username}
}
I have all of it working / outputting properly, but cant seem to figure out how to use the msRTCSIP-UserEnabled attribute value as a conditional. I've tried looking around, but everything I see on this is for pulling info from AD not a specific file list.
Punt: Try storing the value in a variable prior to checking it in the if statement. It's been a few years since I've done scripting so I'm uncertain about best syntax, but the if condition (the part between the parentheses) looks suspect to me. Separating out the value into a variable would simplify the if condition. – Bob Smiley – 2017-07-21T15:57:49.127
Thats exactly what i had to do. – mweldinger – 2017-07-21T23:23:07.257