Posts Tagged "Powershell"

Check objectVersion on all Domain Controllers after schema update with PowerShell

Posted by on Feb 2, 2013 in Active Directory, Powershell | 1 comment

Check objectVersion on all Domain Controllers after schema update with PowerShell

Just copy and paste into PowerShell (Active Directory Module for Windows PowerShell) to get the version of AD schema on all domain controllers in current domain: $schemaContext = Get-ADRootDSE | %{$_.schemaNamingContext} Foreach ($dc in ([System.DirectoryServices.ActiveDirectory.DomainController]::findall( (new-object System.DirectoryServices.ActiveDirectory.DirectoryContext("Domain",$env:USERDNSDOMAIN)))) | %{$_.name}) { $path = 'LDAP://' + $dc + '/' + $schemaContext $Object = [adsi]$path $dc + ' ' + $Object.objectversion...

Read More

How to get a list of all tapes a System Center DPM Server knows about?

Posted by on Nov 15, 2012 in Data Protection Manager, Powershell | 1 comment

How to get a list of all tapes a System Center DPM Server knows about?

I have a long list of DPM tapes – a very long list… and most of them are offline. But how would you know what data is stored on what tape? Jeff Wouters wrote a blogpost about it at http://jeffwouters.nl/index.php/2012/04/list-all-tapes-in-dpm-with-a-powershell-oneliner/ He put the list of tapes in a text file using Get-ProtectionGroup –DPMServer DPM001 | get-tape | select barcode | sort | out-file E:\Temp\DPMTapeBarcodeList.txt I prefer to have a quick overview in powershell itself by using gc env:computername | Get-ProtectionGroup | get-tape | fl This will list all tapes known...

Read More

Restore deleted computer object including BitLocker recovery information

Posted by on Aug 10, 2012 in Active Directory, BitLocker, Powershell | 6 comments

Recovery of Active Directory objects became much easier with the introduction of AD recycle bin feature in Windows Server 2008 R2. Simply use the restore-adobject PowerShell cmdlet and you’re done. But what if you are using BitLocker with its keys stored in AD? You can still restore the computer object once it got deleted. But the attached msFVE-RecoveryInformation objects will not get restored automatically. This small PowerShell cmdlet will do the work for you: import-module ActiveDirectory function RestoreComputer($computername) { If ($computername.substring($computername.length -...

Read More

How to get the number of volumes used by DPM 2010?

Posted by on Apr 16, 2012 in Data Protection Manager, Powershell | 0 comments

Just a quick hit that tells you how many volumes Microsoft Data Protection Manager uses. I got 848… $dpmserver = $env:computername #localhost or type your dpm server's name here $dpmdisks = get-dpmdisk -dpmservername $dpmserver $volumecount = 0 $dpmdisks | ForEach-Object { $volumecount += $_.VolumeCount } $volumecount

Read More

How to mark a DPM tape containing active recovery points as free

Posted by on Mar 8, 2012 in Data Protection Manager, Powershell | 9 comments

When trying to mark a tape that contains active recovery points as free in Data Protection Manager you’ll receive an error like this: The selected tapes cannot be marked as free because they belong to protection groups. You need to stop protection of the associated protection groups before you can mark the tapes as free. The protection group that a tape belongs to is listed in the Protection Group column. (ID: 31116) You can still force DPM to mark the tape as free by removing the recovery points. Use the following script in the DPM Powershell. $barcode = "000012L4" #type the...

Read More