Showing posts with label how to. Show all posts
Showing posts with label how to. Show all posts

Tuesday, April 19, 2022

Disable Azure AD Sync and Federated Authentication ( ADFS ) in O365

Applies To : Microsoft Office 365

                    ADFS and AD Sync Tool.


Objective / Scenario :

we want to transfer the custom domain "abc.org" from O365 Tennent "A" to Office 365 Tennent "B".

But, "abc.org" is configured with On-Premise Active Directory and ADFS Authorization tool, moreover, we have deleted the ADFS Server prior to disabling it in O365 Tennent, Due to this Users were not able to authenticate with ADFS.

To Authenticate users, the authentication method must change and make the default "onmicrosoft.com" domain to all users to remove the custom domain from Tennent "A".

The below steps demonstrate how to remove ADFS Federated authentication without ADFS accessibility.


Step 1: Open Window PowerShell with "Administrative" rights.

Step 2 : Install MSOnline Module if not installed already " Install-Module MSOnline "

Step 3 : "Connect - MsolService" and Give Username and Password.

Step 4 : "Get-MsolDomain" command to get the Custom domain and Authentication Methods used.




Step 5 : you can see the Custom domain "abc.org" is using "federated" Authentication.

Step 6 : in this step we will disable ADFS "federated" authentication to "managed". 

    Command : "Set-MsolDomainAuthentication - DomainName abc.com -Authentication Managed"

Step 7 : now check once again with "Get-MsolDomain"  custom domain now converted with "Managed" 


Step 8: Still you will not able to do modification in users' primary e-mail due to AD Sync, needs to disable AD Sync with O365.

Step 9 : "Set-MsolDirSyncEnabled -EnableDirSync $false" and Confirm "Y"



Step 10 : Wait for 15 to 30 min to reflect changes.

Step 11 : Now you can change All users' Primary E-mail IDs from Custom Domain to Default Onmicrosoft.com domain.

Step 12 : After successfully changing of primary E-mail id then remove Custom Domain and add it to the new Tennent.

Thursday, November 20, 2014

Exchange 2013 Outlook and OWA Search Does Not Work

Exchange 2013 Outlook and OWA Search Does Not Work

As with all previous versions of OWA, Exchange 2013 has a search function that is above the mail column as seen below.
Exchange 2013 owa search
I came across an issue recently where if you did a search in OWA 2013, no results would be show, no matter what information I used as the search keywords. No matter what no search results where found. In Exchange 2013 , the search index is stored with the Mailbox store where the users are located. To resolve this issue and build the OWA 2013  and the Exchange search index again we needed to do the following. This error may also occur withOutlook clients that are not in cached mode.
1) Stop Service
 navigate to services stop the Microsoft Exchange Search & Microsoft Exchange Search Host Controller service.
2) Locate User Mailbox Database.
Once done locate the folder on your server where the Mailbox database is where the user is trying  to search from. For example mine is here.
C:\Program Files >Microsoft > Exchange Server > V15 > Mailbox > Mailbox Database 1403936621

Exchange 2013 Search database
If you are unsure where the the mailbox database is use the command below from power-shell.

Get-MailboxDatabase "yourmailboxdatabase" |fl name,*path*
Once the path is located you will find a folder name with a long “GUID” and the word Single on the end.
exchange 2013 search guid
3) Rename this folder .old.
We then need to start the Microsoft Exchange Search service again, The server will now begin to rebuild its search index.
Give it plenty of time to rebuild then issue the command below and make sure the status of Content Index Status is seen as healthy.
Get-MailboxDatabaseCopyStatus
As seen below, if it says healthy try your search and you should see that your search results now appear in Outlook and OWA 2013.
Exchange 2013 rebuild search index

Wednesday, November 12, 2014

Setting up Vtiger CRM PBX Manager with Asterisk

Setting up PBX Manager with Asterisk

For official configuration Guide please login to here.

After going through Official configuration guide then I realise that there should be one step by step guide with snapshots for newcomers or who are not familiar with Asterisk PBX and Linux.

I tried to make this step by step very simple and more understandable for all, so please give me any suggestion from your side to make this documentation better.

I have separated configuration parts in different steps.

1) Scenario with Network Diagram.
2) Required Software’s.
3) Vtiger Side Configuration.
4) Asterisk Side Configuration.
5) Troubleshooting.


Network Diagram




Vtiger Server:
                                Windows 7 32 bit , Dual Core CPU , 4 GB RAM , 40 GB HDD.
                                Vtiger 6.1
                                Zoiper SIP Soft Client with 2009 Extension Configured.

Asterisk Server:

Dual Core CPU , 4 GB RAM , 40 GB HDD
AsteriskNOW 5.211.65 (User Any Asterisk Based PBX like FreePBX , Elastix etc..)
Java Jetty Installed.

Note : this scenario has been developed in Virtual Environment ( Vmware Workstation 10 ) in my case.


Configure your Asterisk credentials in Vtiger


After installing Vtiger Asterisk Connector, please follow few simple steps to configure your Asterisk Server information in Vtiger CRM :

1. Login to your CRM instance and click on Setting.png icon on the top right corner of the CRM.

2. Click CRM Settings.

3. Click PBX Manager under Integration in Settings sidebar.

4. Edit Asterisk Server Details.

Vtiger Asterisk App URL - configure server name where Vtiger Asterisk Connector is installed as shown:

Syntax : Protocol://Asterisk_Server_IP:Port

Protocol
http/https
Asterisk_Server_IP
Your Asterisk Server IP
Port
Server Port configured in Vtiger Asterisk Connector config file.

Outbound Context - Vtiger specific context configured in your Asterisk Server

Outbound Trunk - Trunk configured in your Asterisk server for Outgoing Calls.

Vtiger Secret Key - Unique key generated for authentication, which has to be configured in Vtiger Asterisk Connector.

5. Click Save button.

Note : in my case I am not using any trunk for Outgoing Calls, I just want to test internal Calls only in my LAB. So please Add your Outbound trunk Name which is configured in Asterisk GUI -> Connectivity -> Trunks. ( Name is Case Sensitive so be careful ).



 Configure the extension number for each user


For each user who is allowed to handle incoming and outgoing calls from the CRM, the extension number should be configured in the User preferences page.

1. Open My Preferences.

2. Configure user number in CRM Phone Extension field under “More Information” block.

Number format:

Extension: [Extension_number]

e.g., 2001

Once configuration is completed on both sides i.e., Vtiger and Asterisk, you are now ready to make and receive calls in the CRM.


Vtiger Asterisk Connector Installation on Asterisk Server

Introduction
Vtiger Asterisk application acts a gateway to connect to Vtiger CRM from the Asterisk Server. It makes it easy for Vtiger and Asterisk interaction over HTTP when incoming or outgoing calls need to be handled.

Features
Vtiger Asterisk Connector provides following features:

1. Connect to Vtiger and notify the incoming call.

2. Accept commands from Vtiger and forward it to Asterisk (Click-to-Call).

3. Call recording file management.

Installation.








1.       Download Asterisk Connector ( PBXMagager )Add-on from Official Website.

2.       Download WinSCP and connect to Asterisk server .


3.       Transfer VtigerAsteriskConnector-1.2.zip to root folder ( / ).

4.       Login to Asterisk Server by using putty.exe or ssh terminal and unzip VtigerAsteriskConnector with “unzip VtigerAsteriskConnector-x.y.zip” Command.


5.       Open /VtigerAsteriskConnector/conf/ VtigerAsteriskConnector.properties and update information as below.



6.       Copy and Paste the Vtiger Secret Key that is generated in your Vtiger Instance.
You can find this under Vtiger CRM > Settings > Integration > PBXManager > Asterisk Server Details.

7.       Copy Vtiger URL exact the same because it is case sensitive so better to copy and paste from web browser.

8.       Cd /VtigerAsteriskConnector/Bin


9.       ./Start.sh

10.    Test Vtiger Connector website is working or not http://192.168.1.87:8383 the result should be as below.


11.   If you find above result then you are ready with VtigerAsteriskConnector Configuration.

Asterisk Configuration File Changes

1)      Change In extensions.conf ( /etc/Asterisk/extensions_custom.conf )




Create Vtiger SIP Extension

1)      Open Asterisk GUI -> Applications -> Extensions.

2)      Create SIP Extensions.




Configure Asterisk Manager User

1)      Open Asterisk GUI -> Settings -> Asterisk Manager Users

2)      Create “vtiger” User with ALL Permission.

3)      Make 0.0.0.0 / 0.0.0.0 in Deny Entry.

4)      Permit 127.0.0.1/255.255.255.0&192.168.1.0/255.255.255.0&192.168.1.94/255.255.255.255

5)      Click on Submit.

6)      Save Changes.



Check /etc/Asterisk/manager_additional.conf


Add VtigerAsteriskConnector Script in to startup.

1)      Open Asterisk server terminal and give below command.

2)      Echo sh /VtigerAsteriskConnector/bin/start.sh >> /etc/rc.local



Troubleshooting

1)      Monitor Logs in /VtigerAsteriskConnector/Logs

a.       nohup.webapp.<date>.out
b.      nohup.agi.<date>.out

2)      Start or restart VtigerAsteriskConnector Scripts /VtigerAsteriskConnector/bin/
a.       Start.sh
b.      Stop.sh
c.       Agi.sh
d.      Webapp.sh

3)      Check webapp is running or not by visiting http://192.168.1.87:8383 it should show above Scripts in browser.


Tuesday, April 22, 2014

Restore missing Standard TCP/IP Port type for Printer

Restore missing Standard TCP/IP Port type for Printer


 
If the TCP/IP port option is missing you need to re-add it.
First, make sure that the following files are in C:\Windows\System32\:

tcpmib.dll
tcpmon.dll
tcpmon.ini
tcpmonui.dll
 
If they are missing, you will need to copy them there from either the i386 directory (if you have one) or from the original install CD.
Then, copy the following lines to NOTEPAD and save the file to your desktop as “printer.reg”

Windows Registry Editor Version 5.00


[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP Port]
“Driver”=”tcpmon.dll”
 
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP Port\Ports]
“LprAckTimeout”=dword:000000b4
“StatusUpdateInterval”=dword:0000000a
“StatusUpdateEnabled”=dword:00000001


Once it’s saved to your desktop, double-click printer.reg and say “OK” to the warning that you will be adding the keys to your registry.

Reboot the Server and the TCP/IP port option should be back.

Saturday, October 20, 2012

How to modify Default SMTP Banner in Exchange 2010


The SMTP banner is the SMTP connection response that a remote SMTP messaging server receives after it connects to a Receive connector configured on a computer running Microsoft Exchange Server 2010 that has the Hub Transport server role or the Edge Transport server role installed. You may want to modify the default SMTP banner for Internet-facing SMTP Receive connectors on an Edge Transport server so that the server name and messaging server software aren't disclosed by the SMTP banner.
Looking for other management tasks related to connectors? Check out Managing Connectors.
You need to be assigned permissions before you can perform this procedure. To see what permissions you need, see the "Receive connectors" entry in the Transport Permissions topic.
noteNote:
You can't use the EMC to modify the default SMTP banner. Don't use the Specify the FQDN this connector will provide in response to EHLO or HELO field in the Receive connector properties page in the EMC.
You control the SMTP banner by using the Banner parameter in the Set-ReceiveConnector cmdlet or the New-ReceiveConnector cmdlet. The default value of the Bannerparameter is $null. When the Banner parameter isn't specified on a Receive connector, or the Banner parameter is specified with the value of $null, a remote SMTP messaging server that connects to that Receive connector receives the following response.
220 <Servername> Microsoft ESMTP MAIL service ready at <RegionalDay-Date-24HourTimeFormat> <RegionalTimeZoneOffset>


When you specify a value for the Banner parameter on a Receive connector, a remote SMTP messaging server that connects to that SMTP Receive connector receives the following response.
<220 BannerText>
noteNote:
The replacement SMTP banner text string must always start with 220. As defined in RFC 2821, the default service ready SMTP response code is 220.
This example modifies the SMTP banner on the existing Receive connector From the Internet so the SMTP banner displays 220 Contoso Corporation.

Set-ReceiveConnector "From the Internet" -Banner "220 Contoso Corporation"

For detailed syntax and parameter information, see Set-ReceiveConnector.

for More Information Please Visit Microsoft Official Website. : 

Tuesday, October 2, 2012

How to use USMT 4 hardlinking in a Configuration Manager 2007 Task Sequence

How to use USMT 4 hardlinking in a Configuration Manager 2007 Task Sequence

 
Suppose you want to use the USMT 4 feature of hardlinking in a System Center Configuration Manager 2007 Task Sequence, but you notice that the "Capture User State"/"Capture User Files and Settings" and "Restore User State"/"Restore User Files and Settings" tasks do not have any options to perform a local capture with hardlinking.  What's up with that?
Well what's going on is that USMT 4, which introduced hardlinking, shipped after ConfigMgr 2007 so the hardlinking option was not available in ConfigMgr 2007. However, USMT 4 support was added in ConfigMgr 2007 SP2, and via the OSDMigrateAdditionalCaptureOptions and OSDMigrateAdditionalRestoreOptions variables, a hardlink user migration can be accomplished in a ConfigMgr 2007 SP2 Task Sequence.
Out of the box, ConfigMgr 2007 SP2 only supports USMT 4 online captures, or captures that take place while in the full Windows OS. ConfigMgr 2007 SP2 does not support USMT 4 offline captures, or captures that take place while in WinPE. Offline captures are possible using the UDI feature of MDT 2010 Update 1 when it is integrated with ConfigMgr 2007 SP2.
With that said, there are several ways that a USMT 4 hardlink migration can be accomplished in a ConfigMgr 2007 Task Sequence, including:
  1. Create a new ConfigMgr 2007 Task Sequence that supports USMT 4 hardlinking.
  2. Modify an existing ConfigMgr 2007 Task Sequence that have the "Capture User State" and "Restore User State" tasks to support USMT 4 hardlinking.
Since USMT 4 support was not added until SP2 of ConfigMgr 2007, SP2 of ConfigMgr 2007 is required for hardlinking.
USMT 4 is supported in the following refresh scenarios:
  • Windows XP --> Windows Vista
  • Windows XP --> Windows 7
  • Windows Vista --> Windows Vista
  • Windows Vista --> Windows 7
  • Windows 7 --> Windows 7
USMT 4 is not supported for Windows XP --> Windows XP scenarios.
The first step is to ensure that the USMT 4 package is created:

Create the USMT 4 Package

When ConfigMgr 2007 SP2 is installed on the site server, the Windows Automated Installation Kit 2.0 (WAIK 2.0) is automatically installed. USMT 4 is part of WAIK 2.0 and its binaries can be found within the WAIK 2.0 installation folder.
  1. In the ConfigMgr 2007 Admin console on the site server, navigate to the "Computer Management" --> "Software Distribution" --> "Packages" node.
  2. Right click on the "Packages" node and select "New" --> "Package".
  3. In the "General" window, fill out the appropriate fields. The name of the package should describe it as the USMT 4 package. Click on the "Next >" button.
  4. In the "Date Source" window:
    • Check the option "This package contains source files"
    • Click on the "Set..." button under "Source directory".
      • Click on the option "Local drive on site server"
      • Click on the "Browse..." button under "Source directory: "
      • Navigate to and select C:\Program Files\Windows AIK\Tools\USMT folder and click on the "OK" button. Make sure to select the root of the USMT folder. DO NOT directly select either the amd64 or x86 folders. When running, the Task Sequence will automatically choose the appropriate binaries.
    • Click on the "OK" button.
    • Click on the "Next >" button.
  5. In the "Data Access" window, click on the "Next >" button.
  6. In the "Distribution Settings" window, click on the "Next >" button.
  7. In the "Reporting" window, click on the "Next >" button.
  8. In the "Security" window, click on the "Next >" button.
  9. In the "Summary" window, click on the "Next >" button.
  10. In the "Wizard Complete" window, click on the "Close" button.
  11. In the ConfigMgr 2007 Admin console, navigate to the "Computer Management" --> "Software Distribution" --> "Packages" node and find the newly created USMT 4 package.
  12. Expand the USMT 4 package and then right click on "Distribution Points" and select "New Distribution Points".
  13. Go through the "New Distribution Points Wizard" and make sure that the USMT 4 package is placed on some Distribution Points.
Notes:
  • It is not required to create a Program as part of the USMT 4 package.
  • In Step 5, if the WAIK 2.0 is installed on a different drive or directory, make sure to adjust the path C:\Program Files\Windows AIK\Tools\USMT accordingly.
  • It is recommended that the above steps be taken in a ConfigMgr 2007 console running on the site server where the WAIK 2.0 is installed. However, the above steps can be taken in a ConfigMgr 2007 admin console that is not running on the site server. In Step 5 , instead of selecting the option "Local drive on site server", select the option "Network path (UNC name)" and browse to a network share that has the WAIK 2.0 installed or the USMT 4 binary source files.
  • Please remember that the USMT 4 source files should contain BOTH the amd64 and x86 directories. The package should point to the root of the USMT 4 directory. It should NOT point directly to either the amd64 and x86 directories.
After creating the USMT 4 package, select the method below to enable USMT 4 hardlinking in a Task Sequence.

Method 1: Create a new ConfigMgr 2007 Task Sequence that supports USMT 4 hardlinking
  1. In the ConfigMgr 2007 Admin console, navigate to the "Computer Management" --> "Operating System Deployment" --> "Task Sequences" node.
  2. Right click on the "Task Sequences" node and choose "New" --> "Task Sequence".
  3. In the "Create a New Task Sequence" window, select the option "Install an existing image package" and click on the "Next >" button.
  4. In the "Task Sequence Information" window:
    • Next to "Task Sequence name:" text box, give the Task Sequence the desired name.
    • Click on the "Browse..." button next to "Boot Image:" and choose an appropriate Boot Image.
    • Click on the "Next >" button.
  5. In the "Install the Windows Operating System" window:
    • Click on the "Browse..." button next to "Image package:" and select the Operating System Image that is desired to be deployed.
    • Next to the "Image:" drop down box, make sure the desired image is selected.
    • UNCHECK the option "Partition and format the target computer before installing the operating system".
    • If desired, enter the product key next to the "Product Key:" text box.  If using a KMS activation server, this field should be left blank when deploying Windows Vista or Windows 7.
    • If desired, select the option "Always use the same administrator password" and specify the password in the "Password:" and "Confirm password:" text boxes.
    • Click on the "Next >" button.
  6. In the "Configure the Network" window, select "Join a domain" and fill out the appropriate fields. Click on the "Next >" button.
  7. In the "Install the ConfigMgr client" window, click on the "Browse" button and choose a package that contains the ConfigMgr 2007 SP2 install files. Make sure that the package is an SP2 installer of the ConfigMgr 2007 client. Selecting a package that contains either the RTM or SP1 client install files will cause the "Restore User State" task to fail since clients that are not SP2 do not support USMT 4. Click on the "Next >" button.
  8. In the "Configure State Migration" window:
    • Click on the "Browse..." button next to the "USMT Package:" field. Select the USMT 4 package and then click on the "OK" button.
    • Select the option "Save user settings locally". If this option is grayed out, the option "Partition and format the target computer before installing the operating system" was not unchecked in Step 5.
    • If desired, leave the options "Capture network settings" and "Capture Microsoft Windows settings" checked.
    • Click on the "Next >" button.
  9. In the "Include Updates in Image" window, select whether or not to install updates during the Task Sequence, and then click on the "Next >" button.
  10. In the "Install Software Packages" window, add any packages that are desired to be installed during the Task Sequence, and then click on the "Next >" button.
  11. In the "Summary" window, click on the "Next >" button.
  12. In the "Wizard Complete" window, click on the "Close" button.
  13. In the ConfigMgr 2007 Admin console, navigate to the "Computer Management" --> "Operating System Deployment" --> "Task Sequences" node.
  14. Right click on the newly created Task Sequence and choose "Edit".
  15. Click on the "Set Local State Location" task. Next to the "Value:" text field, change it from %_SMSTSUserStatePath% to %SystemDrive%\UserState.
  16. Make sure that the "Set Local State Location" task is still selected and go to "Add" --> "General" --> "Set Task Sequence Variable". This should create a "Set Task Sequence Variable" task in after the "Set Local State Location" and before "Capture User Files and Settings" tasks.
  17. In the newly created "Set Task Sequence Variable Task":
    • Next to the "Name:" text box, enter in:
      Set USMT Additional Capture Options
    • Next to the "Task Sequence Variable:" text box, enter in:
      OSDMigrateAdditionalCaptureOptions
    • Next to the "Value:" text box, enter in:
      /nocompress /hardlink
  18. Click on the "Capture User Files and Settings" task to select it:
    • Check the option "Enable verbose logging"
    • Click on the "Options" tab and then uncheck the option "Continue on error".
  19. Click on the "Restore User Files and Settings" task and then go to "Add" --> "General" --> "Set Task Sequence Variable". This should create a "Set Task Sequence Variable" task after the "Restore User Files and Settings" group and before the "Restore User Files and Settings" task.
  20. In the newly created "Set Task Sequence Variable Task":
    • Next to the "Name: " text box, enter in:
      Set USMT Additional Restore Options
    • Next to the "Task Sequence Variable:" text box, enter in:
      OSDMigrateAdditionalRestoreOptions
    • Next to the "Value:" text box, enter in:
      /nocompress /hardlink
  21. Click on the "Restore User Files and Settings" task to select it and then click on the option "Enable verbose logging".
  22. Click on the "OK" or "Apply" button to save the task sequence.
Please make sure to look at the notes section at the end of this post for detailed explanations on some of the above actions.
Method 2: Modify an existing ConfigMgr 2007 Task Sequence that has the "Capture User State" and "Restore User State" tasks in it


If a ConfigMgr 2007 Task Sequence that was used with USMT 3 or USMT 4 exists and was setup for either network capture with a State Migration Point (SMP) or for local capture on the hard drive without hardlinking, it can be modified to support USMT 4 local capture with hard linking.

The below instructions assume that there is already a "Capture User State"/"Capture User Files and Settings" and "Restore User State"/"Restore User Files and Settings" tasks in the appropriate spots in the Task Sequence. If these tasks do no already exist in the Task Sequence, it is recommended to create a new Task Sequence using the method detailed above.
The below instructions are also not valid for a ConfigMgr 2007 Task Sequence that was created using the MDT 2010/MDT 2010 Update 1 "Create Microsoft Deployment Task Sequence" Wizard. Please see the section "More Information" for additional information regarding Task Sequences created using the MDT 2010/MDT 2010 Update 1 "Create Microsoft Deployment Task Sequence" Wizard:
  1. In the ConfigMgr 2007 Admin console, navigate to the "Computer Management" --> "Operating System Deployment" --> "Task Sequences" node.
  2. Right click on the affected Task Sequence and choose "Edit".
  3. Find any "Request State Store"/"Request User State Store" and "Release State Store"/"Release User State Storage" tasks and disable them. They can be disabled by clicking on the individual tasks, clicking on the "Options" tab, and then clicking on the option "Disable this step". If none of these tasks exist in the Task Sequence, continue to Step 4.
  4. Find any "Format and Partition Disk"/"Partition Disk"/"Partition Disk 0" tasks and disable them. They can be disabled by clicking on the individual tasks, clicking on the "Options" tab, and then clicking on the option "Disable this step". If none of these tasks exist in the Task Sequence, continue to Step 5.
  5. If a task "Set Local State Location" already exists before the "Capture User State"/"Capture User Files and Settings" task, skip to Step 6. Otherwise, click on the "Capture User State"/"Capture User Files and Settings" task to select it and then go to "Add" --> "General" --> "Set Task Sequence Variable". This should create a "Set Task Sequence Variable" task before the "Capture User State"/"Capture User Files and Settings" task.
  6. In the newly created "Set Task Sequence Variable Task":
    • Next to the "Name:" text box, enter in:
      Set Local State Location
    • Next to the "Task Sequence Variable:" text box, enter in
      OSDStateStorePath
    • Next to the "Value:" text box, enter in:
      %SystemDrive%\UserState If there was already a "Set Task Sequence Variable Task" task in the Task Sequence that sets the OSDStateStorePath variable, make sure that it is configured to the above value.
  7. Click on the "Capture User State"/"Capture User Files and Settings" task to select it and then go to "Add" --> "General" --> "Set Task Sequence Variable". This should create a "Set Task Sequence Variable" task before the "Capture User State"/"Capture User Files and Settings" task and after the "Set Local State Location".
  8. In the newly created "Set Task Sequence Variable Task":
    • Next to the "Name:" text box, enter in:
      Set USMT Additional Capture Options
    • Next to the "Task Sequence Variable:" text box, enter in:
      OSDMigrateAdditionalCaptureOptions
    • Next to the "Value:" text box, enter in:
      /nocompress /hardlink If there was already a "Set Task Sequence Variable Task" in the Task Sequence that defined the variable OSDMigrateAdditionalCaptureOptions with some options, such as /ue, then add the additional options /nocompress /hardlink in the "Value:" text box after the options that already exist. Make sure that there is a space between each option.
  9. Click on the "Capture User Files and Settings"/"Capture User State" task to select it:
    • Ensure that the package under "User state migration tool package:"  is a USMT 4 package.
    • Check the option "Enable verbose logging".
    • Click on the "Options" tab and then uncheck the option "Continue on error".
  10. Click on the "Setup Windows and ConfigMgr" task. Ensure that the package selected next to the "Package" field is a package that installs the SP2 version of the ConfigMgr 2007 client. RTM and SP1 versions of the client will not work with USMT 4.
  11. Click on the "Restore User State"/"Restore User Files and Settings" task and then go to "Add" --> "General" --> "Set Task Sequence Variable". This should create a "Set Task Sequence Variable" task before the "Restore User State"/"Restore User Files and Settings" task.
  12. In the newly created "Set Task Sequence Variable Task":
    • Next to the "Name: " text box, enter in:
      Set USMT Additional Restore Options
    • Next to the "Task Sequence Variable:" text box, enter in:
      OSDMigrateAdditionalRestoreOptions
    • Next to the "Value:" text box, enter in:
      /nocompress /hardlink If there was already a "Set Task Sequence Variable Task" in the Task Sequence that defined the variable OSDMigrateAdditionalRestoreOptions with some options, such as /lac, then add the additional options /nocompress /hardlink in the "Value:" text box after the options that already exist. Make sure that there is a space between each option.
  13. Click on the "Restore User Files and Settings"/"Restore User State" task:
    • Ensure that the package under "User state migration tool package:"  is a USMT 4 package.
    • Check the option "Enable verbose logging".
  14. Click on the "OK" or "Apply" button to save the task sequence.
Notes on the two above methods:
  • A "Format and Partition Disk" task is not desired in the above Task Sequences. If a format and partition of the disk occurred, it would wipe all data on the drive, including the State Store, and the captured data would be lost. Instead, to erase content off of the drive in preparation to install the new Windows OS, during the "Apply Operating System Image"/"Apply Operating System" task, a recursive delete of all files and directories occurs on the drive minus a few protected folders.
The protected folders that are not deleted include the Task Sequence cache folder and the State Store folder. The Task Sequence cache folder path is stored in the variables _SMSTSMDataPath , _SMSTSClientCache, and _SMSTSNewClientCachePathToCleanup and usually resolves to the path C:\_SMSTaskSequence. The State Store path is stored in the variable OSDStateStorePath. The protected folders that will not be wiped are stored in the variable _SMSTSProtectedPaths.
In the SMSTS.log you will see the recursive delete and wipe process logged as something similar to the following:
Wiping C:\                                                                                               ApplyOperatingSystem
Set "C:\_SMSTaskSequence" to not be wiped                                             ApplyOperatingSystem
Set "%OSDStateStorePath%" to not be wiped                                             ApplyOperatingSystem
Set "%_SMSTSClientCache%" to not be wiped                                            ApplyOperatingSystem
Set "%_SMSTSNewClientCachePathToCleanup%" to not be wiped                ApplyOperatingSystem
Skipping C:\_SMSTaskSequence for wipe                                                   ApplyOperatingSystem
Calculating expected free space.                                                                ApplyOperatingSystem
Reporting deletion progress.                                                                      ApplyOperatingSystem
Successfully wiped C:\                                                                              ApplyOperatingSystem
  • In Step 15 (Method 1) and Step 6 (Method 2), the State Store path location is changed from %_SMSTSUserStatePath% to %SystemDrive%\UserState. The _SMSTSUserStatePath variable normally resolves to the path C:\_SMSTaskSequence\UserState. The C:\_SMSTaskSequence folder is the Task Sequence cache folder. This is done to fix several issues that can be caused by saving the State Store in the Task Sequence cache folder. These problems include:
    1. Whether or not a Task Sequence succeeded, the Task Sequence usually exits cleanly. When the Task Sequence exists cleanly, it deletes the Task Sequence cache folder of C:\_SMSTaskSequence. This can be a problem if the Task Sequence fails for whatever reason before the captured user data is restored.
      If the Task Sequence fails but exists cleanly before the user data is restored, then the cache folder of C:\_SMSTaskSequence is deleted, which will cause the C:\_SMSTaskSequence\UserState user State Store folder located within the C:\_SMSTaskSequence folder to also be deleted. The captured data will then be deleted and lost before it can be restored.
      If instead the State Store is specified to be a folder outside of the Task Sequence cache folder, such as C:\UserState, when the Task Sequence exists cleanly, it will not automatically delete the State Store since it is no longer within the Task Sequence cache folder. The Task Sequence cache folder will still be deleted, but the State Store will not. In case of Task Sequence failures before user data is restored, user data can still be restored from the State Store using manual methods.
      See KB958808 for additional information:
      User data from the USMT may be deleted unexpectedly by the task sequence engine during the operating system deployment process in System Center Configuration Manager 2007 SP1
      http://support.microsoft.com/kb/958808

      Note: KB958808 does not have to be installed in ConfigMgr 2007 SP2 as this hotfix is already included as part of SP2.
    2. Given the following scenario on a PC:
      1) PC has two (or multiple) drives or partitions
      2) User profiles and Windows are located on the first drive or partition (assume drive letter C:)
      3) Second drive or partition has more available free space than the first (assume drive letter D:)
      then the Task Sequence cache folder will probably be created on the second drive/partition (D:).
      In these scenarios the variable _SMSTSUserStatePath would resolve to the path D:\_SMSTaskSequence\UserState. This is a problem when using USMT 4 hardlinking because the hardlink store has to be on the same drive/partition as Windows and the user profiles. In the above scenario, Windows and the user profiles would be on C:, but the State Store would be created on D:. USMT 4 will actually capture the data in this scenario and not cause any errors, but the captured data will be invalid and it will not be able to be properly restored.
      By making sure that we save the State Store to the drive that contains Windows and user profiles via the variable SystemDrive, we make sure that this problem does not occur.
    3. There are known scenarios when going from a Windows OS with UAC off to a Windows OS with UAC on that will cause permissions not to be set properly on the State Store if the State Store is located within the Task Sequence cache folder. In these scenarios, user data is restored successfully, but the user will receive an "Access Denied" error message when trying to access their files. Saving the State Store outside of the Task Sequence cache folder will resolve the problem.
  • Even though in Step 15 (Method 1) and Step 6 (Method 2) it is recommended that the State Store be saved to a location outside of the Task Sequence cache folder so that it is not automatically deleted, it is still advisable to delete the State Store at some point after the Task Sequence has completed and the user state has been verified that it has been restored successfully. This can be done properly via the usmtutils.exe utility included with USMT 4. To properly remove the State Store, run the command:
usmtutils.exe /rd <Path_to_State_Store>
where <Path_to_State_Store> is the path as specified in the OSDStateStorePath variable via the "Set Local State Location" task (without the brackets <>).
Not deleting the State Store can cause the following problems:
  • If an administrator tries to access the State Store, it may change the permissions of all of the user files in the State Store to the administrator's permissions. This may cause users not to be able to access their files and they may receive "Access Denied" error messages. For this reason it is recommended that an administrator not try to access the State Store directly.
  • A user deleting files in their profile will not cause the actual file to be deleted since a second link exists to the file in the State Store. Although the user will no longer see the file in their profile, the link to the file will still exist in the State Store, and disk space will not be freed up.
  • In Step 18 (Method 1) and Step 9 (Method 2), the option "Continue on Error" is disabled. This option is originally enabled because with USMT 3, USMT 3 could report a lot of false positive errors, causing the task to un-necessarily fail. However this has been improved in USMT 4 and this situation should rarely happen with USMT 4.
    If the option is left checked and the USMT 4 state capture fails for some reason, the Task Sequence will continue and eventually wipe the drive at the "Apply Operating System Image"/"Apply Operating System" task, causing all user files and settings to be deleted and lost. For this reason it is safer to leave this option unchecked when using USMT 4. Leaving the option unchecked will cause the Task Sequence to fail in the event that users' files are not captured successfully, which is a desired outcome.
  • In Steps 18 and 21 (Method 1) and Steps 9 and 13 (Method 2), the option "Enable verbose logging" is enabled. This is optional, but it is advisable to leave this option enabled to help troubleshoot USMT 4 capture and restore failures. Enabling verbose logging will cause the capture and restore tasks to take a bit longer, but will the add the benefit of having more detailed logs to help resolve problems.
  • The tasks "Request State Store" and "Release State Store" are not needed in the Task Sequences that performs local capture with hardlinking because these tasks are only used when a State Migration Point (SMP) is being used. An SMP is only used when the State Store is saved to a network location. When using hardlinking, the State Store is always saved to the local hard drive and an SMP is not used.
  • In Steps 17 and 20 (Method 1) and Steps 8 and 12 (Method 2), please make sure to make the distinction between the variables specified in the tasks "Set USMT Additional Capture Options" and "Set USMT Additional Restore Options". The variables have similar names but they are different. One is OSDMigrateAdditionalCaptureOptionsand the other is OSDMigrateAdditionalRestoreOptions.

More Information

What is a hardlink and why use the USMT 4 feature of hardlinking?

Hardlinking is a feature of NTFS where multiple links can exist to one file on the hard drive. As long as one link exists, the file is not deleted. When a file has multiple links to it, the file will appear to exist in different locations in the file system, but the file only exists once on the hard drive. When the file is deleted from one location, as long as other links to the file still exist, the file is not actually deleted, and the file will still appear in the other locations that it has links to. The file is not deleted until it has been deleted from all of the locations that it has links to.
When USMT local capture is used without hardlinking, files are copied from their original location into the local State Store. For this reason, there has to be sufficient space on the hard drive to store all of the captured files. Even when compression is used, this can mean needing enough space on the hard drive somewhere in the area of almost double the amount of space taken up by the original files. If the original files take 30GB of space, then the hard drive will need about 30GB of free space on it.
When USMT 4 with hardlinking is used, instead of a file being copied to the local State Store, a second link to the file is created in the local State Store. The time taken to create the link to the file in the State Store is almost instantaneous, does not vary with the size of the file, and is much faster than trying to copy the file to the local State Store. The time it takes to capture 30GB of data will only take a bit longer than the time it takes to capture 1GB of data. When not using hardlinking, the amount of time taken to capture 30GB of data would be significantly longer than capturing 1GB of data.
Additionally hardlinking requires almost no additional hard drive space. The only additional hard drive space taken by USMT 4 with hardlinking are administrative files that keep track of where the files need to be restored to. This usually only takes a few MB of disk space vs. the potential GB of disk space taken when hardlinking is not used.
When USMT 4 with hardlinking is used in a ConfigMgr 2007 SP2 Task Sequence via the "Capture User State" task and the OSDStateStorePath and OSDMigrateAdditionalCaptureOptions variables, during the "Capture User State" task, new links are created for the captured files in the State Store location . All of the original links to the files are then deleted during the "Apply Operating System Image" task via recursive delete and wipe of the hard drive. However, because a second link exists in the State Store, and because the State Store is not deleted or wiped during the "Apply Operating System Image" task, the original files remains intact and are not deleted. Later in the Task Sequence via the "Restore User State" task and the OSDStateStorePath and OSDMigrateAdditionalRestoreOptions variables, the original links to the files are recreated back to their original location.
USMT 4 hardlinking also has the advantage over saving the State Store on a network location, such as a State Migration Point (SMP), in that it does not have to take the time to copy the files up to the network share, bandwidth is not used, and a server with plenty of disk space for saving the State Stores is not needed.
To summarize, USMT 4 with hardlinking has the following advantages:
  1. It is significant faster than either copying the captured files to the local State Store or a State Store located on a network share (SMP).
  2. It requires only a few additional MB of disk space vs potential GB of disk space, whether on the local hard drive or on a network share on a server (SMP).
  3. It saves network bandwidth when opting to use hardlinking over a network share (SMP).
The only disadvantage that hardlinking has is that it could potentially run into problems if there is file corruption on the hard drive, the hard drive has bad sectors, or the hard drive is having some other type of problems. However these problems would also be exposed when using local capture without hardlinking. In these scenarios, running a CHKDSK /R on the hard drive is advisable, and a full format of the drive may also be advisable. A network share (SMP) may be needed in these cases.

Why are the two above methods not valid when using a ConfigMgr 2007 Task Sequence created with the MDT 2010/MDT 2010 Update 1 "Create Microsoft Deployment Task Sequence" Wizard?

The above methods are not valid when using a ConfigMgr 2007 Task Sequence created with the MDT 2010/MDT 2010 Update 1 "Create Microsoft Deployment Task Sequence" Wizard because the Task Sequences created using the Wizard already have hardlinking enabled by default.
If a ConfigMgr 2007 Task Sequence created with the MDT 2010/MDT 2010 Update 1 "Create Microsoft Deployment Task Sequence" Wizard is inspected, it will be missing the "Set Task Sequence Variable" tasks that set the variables OSDStateStorePath, OSDMigrateAdditionalCaptureOptions, and OSDMigrateAdditionalRestoreOptions. So if the Task Sequence is missing the steps that sets these variables, and these variables are required to do hardlinking, how does the Task Sequence accomplish hardlinking?
It does this via the task "Determine Local or Remote UserState" task and the MDT script ztiuserstate.wsf. If the USMT 3 package is selected at the "Determine Local or Remote UserState" task, the ztiuserstate.wsf script determines if there is enough space on the hard drive to do a local capture (without hardlinking since it is USMT 3), and if not, it will perform a network capture via a State Migration Point (SMP). Based on which capture method determined by the ztiuserstate.wsf script is used, it defines the appropriate variables, OSDStateStorePath, OSDMigrateAdditionalCaptureOptions, and OSDMigrateAdditionalRestoreOptions, and along with conditions set on the relevant tasks, the Task Sequence will perform the appropriate capture.
However if the USMT 4 package is selected at the "Determine Local or Remote UserState" task, since disk space is not an issue, the ztiuserstate.wsf script will always default to local capture with hardlinking. It will then set the appropriate variables for the Task Sequence to perform a hardlink migration.
There is one problem though with using the ztiuserstate.wsf script. The ztiuserstate.wsf script defaults the State Store to the subdirectory StateStore within the Task Sequence cache folder. For the reasons stated in the notes above about saving the State Store within the Task Sequence cache folder, it is not always desirable to save the State Store within the Task Sequence cache folder.
The Task Sequence created by the MDT 2010/MDT 2010 Update 1 "Create Microsoft Deployment Task Sequence" Wizard actually works around the first issue (State Store is deleted even if the data was not restored) by moving the State Store out of the Task Sequence cache folder via the ztimovestatestore.wsf script and the "Move State Store" task. The State Store is moved whether or not the Task Sequence succeeds or fails. However the other two problems can still happen.
To resolve the other two problems and save the State Store outside of the Task Sequence cache folder when using a Task Sequence created with the MDT 2010/MDT 2010 Update 1 "Create Microsoft Deployment Task Sequence" Wizard, follow the below steps:
  1. In the ConfigMgr 2007 Admin console, navigate to the "Computer Management" --> "Operating System Deployment" --> "Task Sequences" node.
  2. Right click on the affected Task Sequence created using the MDT Wizard and choose "Edit".
  3. Click on the "Determine Local or Remote UserState" task and then go to "Add" --> "General" --> "Set Task Sequence Variable". This should create a "Set Task Sequence Variable" task after "Determine Local or Remote UserState" task but before the "Request State Store" task.
  4. In the newly created "Set Task Sequence Variable Task":
    • Next to the "Name:" text box, enter in:
      Set Local State Location
    • Next to the "Task Sequence Variable:" text box, enter in
      OSDStateStorePath
    • Next to the "Value:" text box, enter in:
      %SystemDrive%\StateStore
  5. Click on the "OK" or "Apply" button to save the task sequence.
The above steps resets the variable OSDStateStorePath to a path outside of the Task Sequence cache folder after the "Determine Local or Remote UserState" task and the ztiuserstate.wsf script sets it to the StateStore subdirectory within the Task Sequence cache folder.

Can an existing ConfigMgr 2007 Task Sequence that does not have any USMT tasks including the "Capture User State" and "Restore User State" tasks be modified to do USMT 4 hardlinking?

Yes, but the order of the steps and where they are placed in the Task Sequence are critical. The five tasks that need to be added, and the order that they need to run in are as follows:
  • Set Local State Location
  • Set USMT Additional Capture Options
  • Capture User State
  • Set USMT Additional Restore Options
  • Restore User State
In addition, any "Format and Partition Disk" tasks need to be disabled.
The first three tasks, Set Local State Location, Set USMT Additional Capture Options, and Capture User State, have to run in the original full Windows OS before the Task Sequence boots into WinPE. This is usually before a "Restart Computer" task, such as the "Restart in Windows PE" task. The tasks also have to be placed into a group that has a condition where it only runs in the full Windows OS and not in WinPE. This can be accomplished by setting a condition on the group where the Task Sequence variable _SMSTSInWinPE equals false. The prevents the tasks from running in Bare Metal scenarios where the PCs are booted directly into WinPE and state capture is not needed.
The last two tasks, Set USMT Additional Restore Options and Restore User State, have to run in the newly deployed full Windows OS at some point after the "Setup Windows and ConfigMgr" task, preferably towards the end of the Task Sequence after all applications have been installed.
The Capture User State and Restore User State tasks are built in tasks of ConfigMgr 2007. They can be found under the "Add" --> "User State" menu in a Task Sequence.
The Set Local State Location, Set USMT Additional Capture Options, and Set USMT Additional Restore Options are all actually Set Task Sequence Variable tasks. For instructions on how to properly set up these tasks, see the two above methods.
As a general guide and template to modifying the existing Task Sequence, Method 1 above can be used to create a Task Sequence that serves as the template and guide to modifying the existing Task Sequence.