Thursday, December 12, 2013

Migrate Shortcuts to Files on Network Drive

I have struggled to figure out how to use USMT 4.0 and SCCM 2012 SP1 to migrate user desktop's shortcuts which point to network drive during Win7 migration. Shortcuts are not migrate from XP to Win7 :(

The best result I can had was backup and restore the shortcut which pointed to the network drive but not the shortcuts which point to a file in network drive.

And I read below:
http://blogs.technet.com/b/mniehaus/archive/2011/08/24/troubleshooting-the-user-state-migration-tool-4-0.aspx


  • Shortcuts to files on network drives don’t migrate

    • Known issue, you can modify MigUser.xml to remove section with IgnoreIrrelevantLinks (but then all links are retained, even invalid ones).
    I have decided to script it and work together with SCCM Task Sequence in order to migrate all the users' desktop shortcuts.

    To backup shortcut:
    Put below script before USMT step which able to backup all users' desktop shortcut files:

    cd /d %windir%/../Users
    for /f "delims=*" %%i in ('dir/b') DO xcopy %%i\Desktop\"*.lnk" D:\shortcuts\%%i\ /Y /B /Z /G

    To restore shortcut:
    Put below script at any steps after USMT which able to restore all the user's shortcut files:

    cd /d %windir%/../Users
    for /f "delims=*" %%i in ('dir/b') DO xcopy D:\shortcuts\%%i\*.* %%i\Desktop\ /Y /B /Z /G

    Then, remember to delete the D:\shortcuts folder after the shortcut restoration step.

    The scripts worked perfectly in my Win 7 migration. I am able to migrate all the shortcuts to files on network drive (NOTE: limit to User's desktop only).

    Tuesday, December 3, 2013

    How to Delete File(s) with Similar Name from Different Users' Desktop?

    If you want to manage file/shortcut on all the Win 7 Users' Desktops, you can always navigate to C:\Users\Public\Desktop or %AllUsersProfile% to delete or add the file/shortcut.

    I want to use SCCM Task Sequence to delete some shortcuts with similar file name under different users' desktop today. I tried to Google around but most of the blog lead me to %userprofile% which delete the file/shortcut on the current logon user's desktop only

    After google around, check with my script mater (Mr Brian Rayel) and testing, finally we able to delete files with similar names under different user desktops.

    Option 1:
    @echo off
    cd C:\Users
    for /d %%i in (*.*) do del %%i\Desktop\"Sample Of Shortcut*.lnk"

    Option 2 (credit to my colleague, Master Brian Rayel):
    @echo off
    cd /d %windir%/../Users
    for /f "delims=*" %%i in ('dir/b') DO del %%i\Desktop\"Sample Of Shortcut*.lnk" /q

    It will remove all the shortcut start with Sample Of Shortcut*.lnk. For example, Sample Of Shortcut1.lnk, Sample Of Shortcut2.lnk and etc under different user's Desktop.

    Happy trying. :)

    Tuesday, June 26, 2012

    SCCM Admin Console -

    If you have checked all the possible SCCM console issues from http://technet.microsoft.com/en-us/library/bb932213.aspx, but SCCM admin console still cannot launch and you got the following error message at SmsAdminUI.log:



    [3][6/26/2012 3:08:35 PM] :Error returned from WMI Query Engine\r\nMicrosoft.ConfigurationManagement.ManagementProvider.WqlQueryEngine.WqlQueryException\r\nYou do not have security rights to perform this operation.\r\n   at Microsoft.ConfigurationManagement.ManagementProvider.WqlQueryEngine.WqlQueryResultsObject.<GetEnumerator>d__0.MoveNext()
       at Microsoft.ConfigurationManagement.ManagementProvider.WqlQueryEngine.WqlQueryProcessor.ProcessQueryWorker(AsyncOperationDatabase asyncData)
       at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
       at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)\r\nConfigMgr Error Object:
    instance of SMS_ExtendedStatus
    {
    Description = "User \"OCBCATMDEV\\peichen\" does not have permission to read the objects.";
    ErrorCode = 1112017920;
    File = "c:\\qfe\\nts_sms_fre\\sms\\siteserver\\sdk_provider\\smsprov\\sspobjectquery.cpp";
    Line = 1849;
    Operation = "ExecQuery";
    ParameterInfo = "SELECT r.*, s.NetbiosName, s.ClientVersion, s.SMSInstalledSites FROM SMS_PendingRegistrationRecord r left JOIN SMS_R_System s ON r.ConflictSMSID=s.SMSUniqueIdentifier";
    ProviderName = "WinMgmt";
    StatusCode = 2147749889;
    };

    Solution

    Please make sure sccm admin user name is added correctly inside SCCM console.  I found out my SCCM admin console was corrupted which causing me can not add user correctly. For example, I added domain\user at the SCCM console, but, it changed to localhost\user.
    What I did was, i removed the SCCM admin console from MMC at following path:
    ะก:\Users\<[USER]>\AppData\Roaming\Microsoft\MMC\ for Windows Vista, 7, 2008.
    C:\Documents and Settings\<[USER]>\Application Data\Microsoft\MMC\ for Windows XP, 2003.

    Then, add the user into SCCM console again.

    Da lang..... My SCCM admin console can run remotely :)

    Good luck to you.


    Tuesday, June 19, 2012

    Failed to send HTTP request. (Error at WinHttpSendRequest: 12030)

    Scenario:
    I got error messages in my ccmsetup.log for my SCCM Native Mode agent installation via command prompt:

    Failed to send HTTP request. (Error at WinHttpSendRequest:12030)
    DownloadFileByWinHTTP encountered an unrecoverable error


    To solve this issue:
    I was able to proceed my client installation by:

    1. Go to Site Database > Site Management > SCCM Site > Site Settings > Site Systems > 
    2. Click at the \\Server
    3. Select the ConfigMgr management point
    4. Check the "Allow devices to use this management point"



    Then, I rerun my client installation command as "ccmsetup.exe /native:FALLBACK /mp:sccm.poc.com smssitecode=ICG ccmfirstcert=1"

    My agent is appearing in my SCCM console now. :)

    Wednesday, May 16, 2012

    Task Sequence: Image Capture Wizard has failed with the error code

    Scenario:

    I got Task Sequence Error when I try to capture image for my Windows 7.

    The error message is as below:

    Task Sequence Error:
    Running: Image Capture Wizard
    Description:  Task Sequence: Image Capture Wizard has failed with the error code (oxoooo4005).



    After some research, I found out there is a maximum 3 time limit to capture image from same computer.

    http://technet.microsoft.com/en-us/library/cc766514(v=ws.10).aspx
    " Each OS capture will run sysprep command which will reset windows product activation. However, there is a max 3 times per computer limit for the sysprep command. After the 3 time, the clock to reset Windows Product Activation can no longer be reset."

    Solution: 

    To overcome this 3 Sysprep time limitaiton, following are the walkaround:

    1. Open regedit and look for:

    HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus\CleanupState\

    Set to value: 2

    HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus\GeneralizationState\

    Set to value: 7

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\SoftwareProtectionPlatform\SkipRearm

    Set to value:

    Then, run the command:
    msdtc -uninstall (wait a few seconds)
    msdtc -install (wait a few seconds)

    Then, reboot the system and try to run sysprep again.

    It is working to me. Good luck to you. :)

    Wednesday, April 11, 2012

    OSD: Boot from USB

    I wanted to boot the OS from offline media (USB) for a HP laptop. I have changed the BIOS setting which enable boot from USB.

    However, the laptop dint boot from the USB drive after I restart the HP laptop.... >.<
    After few attempts, I pressed F9, it prompted me the "Boot sequence". I choose USB as my 1st option and then restart again.

    Finally, my OSD boot from USB!

    Happy trying!

    Tips for Boot sequence setting:
    IBM - F2/F1
    HP - F9
    Dell - F12

    Saturday, March 3, 2012

    SCCM Blank Report

    My SCCM 2007 R3 is up and running. However, I got blank page when I try to view some SCCM reports.

    Scenario:
    I tried to view SCCM reports from the SCCM console. I found out report which does not required my input (with "Values.." button) is working fine, such as "Computers in a specific site", "Client Assignment Detailed Status Reports".

    When I want to view those reports required my input(report name: Computers discovered by a specific site), then, i got black page as below:


    You have to add the SCCM reporting URL into the Web Browser Trusted Sites. Steps as below:


    1. Open IE, Select Tool (Alt+X) > Internet Option > Security Tab. Select Trusted sites icon and client the Sites button.

    2. Click the Add button to add the reporting URL into the trusted sites.


    3. Now, my report is working fine. 

    I hope this post is going to help you. :)