Scripting

How to install all roles and features of one server on another

Posted by on Jun 13, 2017 in Powershell, Roles and Features | 0 comments

Ever wanted to install all the roles and features that are installed on one server on another server? Easy. Just copy and paste the following command into an elevated powershell on the server where the roles and features are installed. Then copy the output and paste it into an elevated powershell on the other server: Get-WindowsFeature | ? { $_.Installed } | Select Name | ForEach-Object { "Install-WindowsFeature $($_.Name)"...

Read More

How to get some information on Bitlocker using Visual Basic and WMI?

Posted by on Nov 29, 2013 in BitLocker, VB, WMI | 0 comments

How to get some information on Bitlocker using Visual Basic and WMI?

I have been asked on my post about How to get some information on Bitlocker using VBScript and WMI? if I could provide a solution using Visual Basic. Here it is: Imports System.Management 'Need to add System.Management reference to solution Module Module1 Sub Main() Dim arEncryptionMethod = {"None", "AES 128 With Diffuser", "AES 256 With Diffuser", "AES 128", "AES 256"} Dim arProtectionStatus = {"Protection Off", "Protection On", "Protection Unknown"} Dim arConversionStatus = {"Fully Decrypted",...

Read More

System Center 2012 SP1 Operations Manager: Datawarehouse configuration failed to install

Posted by on Feb 19, 2013 in SC Operations Manager, SQL Server, Transact-SQL | 1 comment

System Center 2012 SP1 Operations Manager: Datawarehouse configuration failed to install

While installing Microsoft System Center 2012 SP1 Operations Manager I got following error: In the log I could see that Setup could not create the Datawarehouse database: EXEC(@sql);: Threw Exception.Type: System.Data.SqlClient.SqlException, Exception Error Code: 0x80131904, Exception.Message: CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file ‘E:\SQL\Data.mdf’. CREATE DATABASE failed. Some file names listed could not be created. Check related errors. I have a standalone SQL 2012 SP1 server (SQL) and a Windows...

Read More

Cannot insert duplicate key error while upgrading SCCM 2012 to SP1

Posted by on Feb 5, 2013 in SC Configuration Manager, SQL Server, Transact-SQL | 1 comment

Cannot insert duplicate key error while upgrading SCCM 2012 to SP1

The following error occurred during SP1 update of Microsoft System Center 2012 Configuration Manager: ERROR: SQL Server error: [23000][2627][Microsoft][SQL Server Native Client 11.0][SQL Server]Violation of PRIMARY KEY constraint ‘CollectionQueryRuleTables_PK’. Cannot insert duplicate key in object ‘dbo.CollectionQueryRuleTables’. The duplicate key value is (16777228, 1, vSMS_R_System). Configuration Manager Setup 05.02.2013 09:12:18 4084 (0x0FF4) The easiest way would be to delete the corresponding rows from CollectionQueryRuleTables table in your SCCM database. This...

Read More

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