Get ad user set ad user where clause

so, how would i set an ad paramater eg. fax attribute for arguments sake
but based on where clause, eg where location -eq Texas

plus i plan to import a csv for it

set fax number to ex, where attribute -eq something

I wouldn’t use a where-object for this. Always remember it’s better to filter as far left as you can. You can use either -Filter or -LdapFilter to filter for your location and pass those AD objects directly to the setter cmdlet.

so ive got it working nicely with ldap filter
im confused on the set ad user part now

set-aduser, is about knowing the identity, i know the identiy after i filter on employee id

You would just pipe that output of Get-ADUser to Set-ADUser.

got it thanks, working

thanks for pointing tme in the right direction

get-qaduser -searchroot “our ou” -LDAPFilter “(random_attrib=value)” |set-qaduser -objectAttributes etc etc}

there are some custom attributes i have

its not happy when using in a for loop

with $user.attrbute

it returns no results on the ldap filter
-LDAPFilter “(attribute=$attribute_id)”

ok i had to set as variable than use it
worked charmingly

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.