TechTalkz.com Logo

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Microsoft > Microsoft Windows Powershell

Notices

Reply
 
Thread Tools Display Modes
Old 26-06-2008, 04:25 PM   #1
Shay Levi
Guest
 
Posts: n/a
Re: get inactive computers


Check this post too regarding which attribute to query:

http://www.vistax64.com/powershell/1...users-csv.html




---
Shay Levi
$cript Fanatic
http://scriptolog.blogspot.com

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> 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>>


  Reply With Quote
Reply

Thread Tools
Display Modes


Google
 


All times are GMT +5.5. The time now is 03:14 AM.


vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2008, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional