![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | get inactive computers Why doesnt this work when i get multiple answeres? When i get only one object it works i.e if i specify a computer name instead of jag-*. (get-qadcomputer -service un.dr -dudip -ip ('lastlogon') jag- *).lastlogon if i do: get-qadcomputer -service un.dr jag-* |%{ (get-qadcomputer $_).lastlogon } it works but is REALLY slow. Im trying to make a script telling me which computers hasnt been used in a couple of months and to deactivate them. Any tip anyone? -gob |
My System Specs![]() |
| | #2 (permalink) |
| | Re: get inactive computers Oh nice! Thats what ive been missing in the rest of my scripts to! Need to read up on select. Thanks alot! -gob On 24 Juni, 10:47, Shay Levi <n...@xxxxxx> wrote: Quote: > Hi Gobba, > Quote: > > (get-qadcomputer -service un.dr -dudip -ip ('lastlogon') jag- *).lastlogon > This can return multiple computer objects and PowerShell can't decide which > object's 'lastlogon' to display. It is good for one object only. > > Take this for example: > > PS 33> dir *.txt > > Mode * *LastWriteTime * * * * * Length Name * * * ** * * * * * * * * > ---- * *------------- * * * * * ------ ---- * * * ** * * * * * * * * > -a--- * 15/05/2008 17:13:04 * 141.7 KB text1.txt * * * * * * * > -a--- * 06/03/2008 14:20:56 * 252.3 KB text2.txt > -a--- * 12/03/2008 14:51:05 * * 56.0 B *text3.txt > > PS 34> (dir *.txt).name > > Which text file name should PowerShell return? > > Try this instead: > > get-qadcomputer -service un.dr jag-* -ip lastlogon | select name, lastlogon > > --- > Shay Levi > $cript Fanatichttp://scriptolog.blogspot.com > > 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> > G> Im trying to make a script telling me which computers hasnt been used > G> in a couple of months and to deactivate them. > G> > G> Any tip anyone? > G> > G> -gob > G> |
My System Specs![]() |
| | #3 (permalink) |
| | Re: get inactive computers Hi Gobba, Quote: > (get-qadcomputer -service un.dr -dudip -ip ('lastlogon') jag- *).lastlogon object's 'lastlogon' to display. It is good for one object only. Take this for example: PS 33> dir *.txt Mode LastWriteTime Length Name ---- ------------- ------ ---- -a--- 15/05/2008 17:13:04 141.7 KB text1.txt -a--- 06/03/2008 14:20:56 252.3 KB text2.txt -a--- 12/03/2008 14:51:05 56.0 B text3.txt PS 34> (dir *.txt).name Which text file name should PowerShell return? Try this instead: get-qadcomputer -service un.dr jag-* -ip lastlogon | select name, lastlogon --- Shay Levi $cript Fanatic http://scriptolog.blogspot.com 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> G> Im trying to make a script telling me which computers hasnt been used G> in a couple of months and to deactivate them. G> G> Any tip anyone? G> G> -gob G> |
My System Specs![]() |
| | #4 (permalink) |
| | Re: get inactive computers Check this post too regarding which attribute to query: LastLogon Date for a List of Users .CSV --- Shay Levi $cript Fanatic http://scriptolog.blogspot.com SL> Hi Gobba, SL> Quote: Quote: >> (get-qadcomputer -service un.dr -dudip -ip ('lastlogon') jag- >> *).lastlogon >> 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> http://scriptolog.blogspot.com 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>> |
My System Specs![]() |
| | #5 (permalink) |
| | Re: get inactive computers If the environment is 2k3+ I would use LastLogonTimeStamp its replicated and this is precisely what it was designed for. "Gobba" <gobba@xxxxxx> wrote in message news:f68830fc-37ce-4cad-8061-6fc207aef418@xxxxxx Quote: > Why doesnt this work when i get multiple answeres? When i get only one > object it works i.e if i specify a computer name instead of jag-*. > > (get-qadcomputer -service un.dr -dudip -ip ('lastlogon') jag- > *).lastlogon > > if i do: > get-qadcomputer -service un.dr jag-* |%{ (get-qadcomputer > $_).lastlogon } > > it works but is REALLY slow. > > Im trying to make a script telling me which computers hasnt been used > in a couple of months and to deactivate them. > > Any tip anyone? > > -gob |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| find inactive computers | PowerShell | |||
| Inactive icons | General Discussion | |||
| Window randomly goes inactive | Vista General | |||
| Inactive computers in Vista Active Directory | Vista General | |||
| Can 2 xp computers and 2 vista computers exist in a family network | Vista networking & sharing | |||