Creating and using Password Hashes and Secure Strings with Powershell

This is how you can generate a Secure String with powershell and use it in your scripts

Load the Secure string from file and use it in your script:

How to uninstall with msiexec using product id guid

You can find the product code by perusing the registry from this base key: HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionUninstall . Press F3 and search for your product name. (If it’s a 32-bit installer on a 64-bit machine, it might be under HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftWindowsCurrentVersionUninstall instead).

Finally, you can find the product code also by using PowerShell:

when you found the Guid ID you can use msiexec to uninstall the application

 

Unlocking ConfigMgr Objects

here is what you need to do when you get the error blow in SCCM2012 console:
“Cannot edit the object, which is in use by ‘’ at Site ‘’.”

This happened as the result of the ConfigMgr console crashing while he had the object open.

To resolve this issue connect with sql management studio to the SQL server where the database is running and then execute the code below:

The query above will get you a list of possible locks on the dB, with the code below you can remove the lock:

Once the record is removed, you should be able to modify the object.

PowerShell – How to find details of Operating System

There were several instances where I had to find details of the operating system using PowerShell. Here, I am providing several PowerShell snippets that return various details of the Operating System.

Name of the Operating System

Is Operating System 32-bit or 64-bit

Name of the Machine

There are many more properties of the Operating System that are exposed. To obtain more details, run the following

 

SCCM 2012 client fails to install Windows 10 Build 10049

When testing the latest Build of Windows 10 I got an error installing the Configuration Manager 2012 R2 client, it fails installing the Windows Update agent with the following error in the CCMSetup.log file.

“File ‘C:WINDOWSccmsetupWindowsUpdateAgent30-x64.exe’ returned failure exit code 775. Fail the installation.”

Continue reading “SCCM 2012 client fails to install Windows 10 Build 10049”

PowerShell – Get Disconnected Mailbox in Exchange Server

If you delete a AD user account it will automatically disconnect the connected mailbox from the AD account and add it to the Disconnected Mailbox list.

Mailbox  will be listed until retention period of 30 days(unless otherwise set)

Gets the list of Disconnected mailbox in the specified Exchange 2007 Server

 

Exchange – Insufficient Access Rights when trying to modify permissions on a public folder

Hi,

Today I faced a new problem, on some Public folders I wasn’t able to change the send as permission. When I tried to configure the send as permission trough the EMC or Powershell I goth this error message:

This what what you need to do to solve this problem:

  1. Create a new public folder and see if you can add the Send-As permissions to it or you will have the same error above. If that the case stop here and this will not sort your issue or may be yes (let me know please)
  2. Open ADSIEdit and check that the ownership of the new folder by going to Default naming context -> DC=domainname,DC=co,DC=uk ->CN=Microsoft Exchange System Objects -> right click on the object of the PF you just created and select properties then Advanced, Ownership and note the name of who owned the public folder (in my case the servername$)
  3. Repeat step 2 for the Public Folder object in question and go to the ownership tab in (in my case it said system is the owner) change it to one that worked in step 2 (in my case the servername$)
  4. Save and try again the send as permission again and it should work.

 

“Change product key” link is not available in Windows 8 or in Windows Server 2012

When you try to change the product key in Windows 8 or in Windows Server 2012, you cannot find a “Change product key” link in the System item in Control Panel.

For example, you want to convert a default setup product key to a Multiple Activation Key (MAK) on a computer that is running Windows 8. However, you cannot find an element in the UI that lets you change the product key.

To change the product key without first activating Windows, use one of the following methods:

Method 1

  1. Swipe in from the right edge of the screen, and then tap Search. Or, if you are using a mouse, point to the lower-right corner of the screen, and then click Search.
  2. In the search box type Slui.exe 0x3.
  3. Tap or click the Slui.exe 0x3 icon.
  4. Type your product key in the Windows Activation window, and then click Activate.

Method 2
Run the following command at an elevated command prompt:

Note You can also use the Volume Activation Management Tool (VAMT) 3.0 to change the product key remotely, or if you want to change the product key on multiple computers.

P2V using SCVMM error’s because of disk space requirement

While performing a P2V with SCVMM 2012 I got the following error message:

There is not enough disk space on the available volumes.
Maximum disk space on the most appropriate volume, accounting for the host resource utilization  (in megabytes): 103450
The virtual machine requirement (in megabytes): 744776
The maximum available space at the time of evaluation, after considering the virtual machine requirements (in megabytes): 103450
ID: 3501 Continue reading “P2V using SCVMM error’s because of disk space requirement”

Windows Server 2012 Failover Cluster Virtual Fibre Channel Adapter Live Migration Error

I’ve got a multiple  node cluster running Windows Server 2012 with Brocade 415/815 4G/8G FC HBA’s connecting to a VX SAN. I am trying to get the virtual HBA’s working in Hyper-V Guest running Windows 2008 R2 (SQL Cluster). I first created 2 virtual SAN Switches one connected to each port on my physical HBA (each physical port connects to a separate fabric). I add two Virtual HBA’s in my Guest, one to each VSAN Switch. When I go to Zone the HBA’s I only see side A of the virtual HBA’s not both A and B. On each fabric I should see two (A and B) WWPN but I only see one, to solve this you must shut down the Guest OS and twist the address set name (copy Set Address A to  Set Address B  and Set Address B to Set address A) I can add disk and everything works, however when I go to Live migrate I get the following error due to side B not being zoned. Live migration of ‘Virtual Machine Win2012_01’ failed.

Virtual machine migration operation for ‘Win2012_01’ failed at migration destination ‘hv-cl07-c2’. (Virtual machine ID 2CE90D02-083C-4012-ACA1-BE8D35EFCA33)

‘Win2012_01’ Synthetic FibreChannel Port: Failed to finish reserving resources with Error ‘Unspecified error’ (0x80004005). (Virtual machine ID 2CE90D02-083C-4012-ACA1-BE8D35EFCA33)

‘Win2012_01’ Synthetic FibreChannel Port: Failed to finish reserving resources with Error ‘Unspecified error’ (0x80004005). (Virtual machine ID 2CE90D02-083C-4012-ACA1-BE8D35EFCA33)

To solve this problem, I have done the following:

  • Updated my drivers to the latest version (3.0.2.21)
  • Remember that the Virtual SAN path must be the same, for example when you create 2 paths then the VSAN A should always connect to FiberSwitch 1 and VSAN B should connect 2 Fberswitch 2. This is because when you try to live migrate the guest OS and the VSAN paths are different the fiberSwitch cannot build the connection.
  • My problem was however that I only had created one host on the SAN and configured all the 8 paths under one host, to resolve my problem I created one host for the address set A and one host for the address set B. So I have always one connected and one disconnected host on my SAN and when I am doing a Live migration then the both hosts are online

I hope that this will solve your problem to.

Best Regards,

Pouyan