![]() |
|
|||||||
| Notices |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Guest
Posts: n/a
|
Re: get inactive computers
Check this post too regarding which attribute to query: --- Shay Levi $cript Fanatic SL> Hi Gobba, SL> >> (get-qadcomputer -service un.dr -dudip -ip ('lastlogon') jag- >> *).lastlogon >> SL> This can return multiple computer objects and PowerShell can't SL> decide which object's 'lastlogon' to display. It is good for one SL> object only. SL> SL> Take this for example: SL> SL> PS 33> dir *.txt SL> SL> Mode LastWriteTime Length Name SL> ---- ------------- ------ ---- SL> -a--- 15/05/2008 17:13:04 141.7 KB text1.txt -a--- SL> 06/03/2008 14:20:56 252.3 KB text2.txt -a--- 12/03/2008 14:51:05 SL> 56.0 B text3.txt SL> SL> PS 34> (dir *.txt).name SL> SL> Which text file name should PowerShell return? SL> SL> Try this instead: SL> SL> get-qadcomputer -service un.dr jag-* -ip lastlogon | select name, SL> lastlogon SL> SL> --- SL> Shay Levi SL> $cript Fanatic SL> G>> Why doesnt this work when i get multiple answeres? When i get only G>> one object it works i.e if i specify a computer name instead of G>> jag-*. G>> G>> (get-qadcomputer -service un.dr -dudip -ip ('lastlogon') jag- G>> *).lastlogon G>> G>> if i do: G>> get-qadcomputer -service un.dr jag-* |%{ (get-qadcomputer G>> $_).lastlogon } G>> it works but is REALLY slow. G>> Im trying to make a script telling me which computers hasnt been G>> used in a couple of months and to deactivate them. G>> G>> Any tip anyone? G>> G>> -gob G>> |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
< Windows Help - MS Office Help - Hardware Support >
| New To Site? | Need Help? |