select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceId = SMS_R_System.ResourceId where (DateDiff(day, SMS_G_System_OPERATING_SYSTEM.InstallDate, GetDate()) < 30)
Recently, I had to uninstall IE9 from a bunch of production machines for a client whose site I am working at. Because of other mitigating circumstances, this had to be done during the day, with notification to the user and without forcing a reboot. After a little bit of digging, I stumbled upon MS article 2579295, and after a little tweaking I was able to create a program with this command:
FORFILES /P %WINDIR%\servicing\Packages /M Microsoft-Windows-InternetExplorer-*9.*.mum /c “cmd /c echo Uninstalling package @fname && start /w pkgmgr /up:@fname /quiet /norestart”
Worked well executed in both a task sequence and as a program. Cheers.
To administer a second or third domain in AD via PowerShell, you’ll need to connect to the other domain thusly:
New-PSDrive -Name ADDriveName -PSProvider ActiveDirectory -Server 'mydomain.com' -root '//RootDSE/'</pre>
This cmdlet will allow you to create the connection as another drive in PowerShell, the same way that the AD: connection is created when you import the AD module. Now, just type Set-Location ADDriveName: and you’re off.