I have a script (lifted straight off a Hey! Scripting Guy! page) which includes the following line:
All I've changed is the word 'user' to 'computer' (the original code snippet was to pull out user account created date and last password set date, I just want the created date for the computer account).
What I need to do is further specify the WHERE command to only query the details for the current computer name but what I've not been able to find is a source that lists the WHERE command syntax.
I could do some kind of IF statement to ignore anything returned for a computer name OTHER than the current one, I know, but that seems awfully clumsy. It would be far more elegant to create code that only queries the one account (rather than all the accounts).
So, does anyone have a URL that shows the SELECT command syntax, please? I'm damned if I can't find one...even this one doesn't tell me very much:
JJ
[small][purple]Variables won't. Constants aren't[/purple][/small]
Code:
"SELECT ADsPath FROM 'LDAP://dc=ourdomainname,dc=com' WHERE objectCategory='computer'"
All I've changed is the word 'user' to 'computer' (the original code snippet was to pull out user account created date and last password set date, I just want the created date for the computer account).
What I need to do is further specify the WHERE command to only query the details for the current computer name but what I've not been able to find is a source that lists the WHERE command syntax.
I could do some kind of IF statement to ignore anything returned for a computer name OTHER than the current one, I know, but that seems awfully clumsy. It would be far more elegant to create code that only queries the one account (rather than all the accounts).
So, does anyone have a URL that shows the SELECT command syntax, please? I'm damned if I can't find one...even this one doesn't tell me very much:
JJ
[small][purple]Variables won't. Constants aren't[/purple][/small]