select objects displayed in results
i have designed form using primalforms lets administrators search ad user accounts, including deleted ones, can restore deleted accounts. form allows search using 5 different criteria (first name, last name, display name, account name , email address). results standard output (as below)
deleted : true
distinguishedname : cn=firstname lastname,ou=standardou,dc=organizationname,dc=com
name : firstname lastname
objectclass : user
objectguid : a1234bcde-567f-9012-g345-6hi78j9012kl
i have been asked people rename accounts (changes of name after marriage/divorce etc.) if can include samaccountname in results prevent issues, trying rename account existing name.
the script used search items standard 1 (though variables used make form work), shown below
please note, have not included entire script 80 lines long , of form layout design not relevant question
$results.text=get-adobject -filter "samaccountname -eq '$($accountname.text)'" -includedeletedobjects | out-string $results.focus()
how can add properties output window? results generated automatically, not select displayed here puzzled how can include additional item.
in above code block $results.text output window, $accountname.text text entered user searching.
hi,
you can add in additional properties using -properties parameter:
$results.text=get-adobject -filter "samaccountname -eq '$($accountname.text)'" -properties samaccountname -includedeletedobjects | out-string $results.focus()
don't retire technet! - (don't give yet - 12,700+ strong , growing)
Windows Server > Windows PowerShell
Comments
Post a Comment