Help with existing Quest ActiveRoles ADManagement Powershell Script

Current script:
 
Get-ADComputer -Filter * -Properties memberof | ? { ($_.memberof | Out-String) -notmatch 'Inactive Computers Policy Exclusion'} | Where-Object { -InactiveFor 90 }

Open in new window


The -InactiveFor 90 function is not working. Do you know why?
LVL 1
the_omnificAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

becraigCommented:
Remember you are dealing with two different things here :
Get-Adcomputer - Microsoft AD cmdlet  (NO Inactive flag available here)
Get-QADComputer - Quest cmdlet (Inactive for is available here)

http://www.quest.com/powershell/activeroles-server.aspx

Once you download and install the cmdlets above this will work for you.
0
the_omnificAuthor Commented:
I am already using Quest
0
the_omnificAuthor Commented:
And it's not working.
0
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

becraigCommented:
I just used this and it worked for me:

Import-Module ActiveDirectory
Import-Module (get-pssnapin Quest.ActiveRoles.ADManagement -Registered).ModuleName
Get-QADComputer -InactiveFor 90 | Select-Object -Expand memberof | Where-Object { $_ -notmatch 'value' }
0
the_omnificAuthor Commented:
This command lists hundreds of results:
Get-QADComputer -InactiveFor 90

This command lists two results:
Get-QADComputer -InactiveFor 90 | Select-Object -Expand memberof | Where-Object { $_ -notmatch 'Inactive Computers Policy Exclusion' }

There are only two computers in the security group 'Inactive Computers Policy Exclusion'.
 
Doesn't make sense.
0
becraigCommented:
This will help you find exactly what you are looking for:
http://dmitrysotnikov.wordpress.com/2010/07/30/locating-obsolete-users-and-computers/

inactivefor might not be the flag you need but rather:
NotLoggedOnFor
0
becraigCommented:
Another little nugget on the flags you can use with Quest:
http://wiki.powergui.org/index.php/Get-QADComputer
0
the_omnificAuthor Commented:
Umm "InactiveFor" is the command I want to use.

Wonder why it's working for you and not me.
0
becraigCommented:
Try usng this script to do what you want:
http://gallery.technet.microsoft.com/ScriptCenter/6b8163d1-5fae-43b5-a664-a2d1f6e1e2da/

I am talking to a few folks and we all agree there is no "simple and safe" way to do this so please approach with an abundance of caution.
0
the_omnificAuthor Commented:
Got it!

Get-QADComputer -NotMemberOf 'Inactive Computers Policy Exclusion' -InactiveFor 90
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
the_omnificAuthor Commented:
Problem solved.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.