Import thumbnailphoto in AD from jpg

The script below will import Jpg file as a thumbnail photo in Active Directory

~Pouyan

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

 

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”