Monday, November 25, 2013

Get list of collections that have dynamic update enabled


The following powershell code will connect to your SCCM, export all the collections, and then select only those that had dynamically add new resources checked, then export to a CSV file.

gwmi sms_collection -computer SERVER -namespace root\sms\site_XXX |% {[wmi] $_.__Path}|select-object CollectionID,Name,RefreshType|where {$_.refreshtype -eq 6}| Export-csv c:\temp\SCCMcollections.csv -NoTypeInformation

If you find this article useful please leave me a comment or click on an ad to show your support.

SSRS The attempt to connect to the report server failed



turns there was no closing tab in the web.config for  
I closed the section with
and then restarted SSRS and this fixed the issue.

If you find this article useful please leave me a comment or click on an ad to show your support.

Monday, November 11, 2013

How to Disable and Move a list of computers in Active Directory

If you want to disable and move an object in powershell using the pipeline you can if the cmdlet you call supports the -Passthru property. This way you could make a single line powershell that would grab a list of objects, process those objects and then passthru the to the next pipeline.

get-content c:\temp\test.txt | % {Get-ADComputer $_ | Disable-ADaccount -PassThru | Move-ADObject -Targetpath "OU=xxx,,DC=DomainName,DC=COM"} 

If you find this article useful please leave me a comment or click on an ad to show your support.