Jump to content


Jepeto 46

Established Members
  • Posts

    43
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Jepeto 46

  1. I had to change mindset and finally got a standalone media which can capture USMT as well. I had to dump the variables in order to find out I was not in the right path. I ended up creating a new variable (it's all one line)

    cmd /c powershell.exe -executionpolicy bypass -command "& {$tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment; $tsenv.Value('USBDrive') = (Get-WMIObject Win32_Volume | ? { $_.Label -eq 'CMBOOT' }).Name.substring(0,2)}"

    After hours of testing I realized that substring(0,2)} is the most important part, it will not capture to E:\ but will to E:

    Now I could set the OSDStateStorePath variable to %USBDrive% and everything started working.

    Here is the basic TS

     

  2. I am trying to create a variable which will capture user data to a USB drive. I run the following command line to get the USB drive

    cmd /c powershell.exe -executionpolicy bypass -command "& {$tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment; $tsenv.Value('USBDrive') = (Get-WMIObject Win32_Volume | ? { $_.Label -eq 'USMT' }).Name}"
    Dumping the variables, it seems right

    OSDEnableTCPIPFiltering = false
    OSDStateStorePath = USBDrive
    SMSTSDisableWow64Redirection = false
    SMSTSLocationMPs = http://ConfigMGR.lab.local
    SMSTSRebootMessage = 
    SMSTSRebootReason = 
    SMSTSRebootRequested = 
    SMSTSRetryRequested = 
    SMSTSUser = 
    USBDrive = E:\

    In the end of the variable dump I see this:

    SMSTSUserStatePath = C:\_SMSTaskSequence\UserState

    however when I try to redirect the capture to the %USBDrive% it's not working. Everything works perfect if I hard code it with E: (which I really prefer not to do).

    The TS order is below

     

  3. Thanks for the great comments, yes, I do miss two cases...never thought about the re-imaging part.

    I am not sure I understand the part of "can't work". Are you referring to the key or the bootable USB? How about if I place the script in the Refresh only section?

    The goal is simple, if we refresh than have the script or MDT DB determines the name, and if bootable media than the ability to select the name, which I found what I need here

    http://blogs.technet.com/b/deploymentguys/archive/2011/08/05/dynamic-computer-naming-in-zti-deployments-using-mdt-and-configmgr.aspx

     

    UPDATE: the script actually works it should be in the Refresh Only. All that is left for me now is to implement the location based install.

  4. Peter

    Thanks for looking

    I placed the script right before the Apply operating system. Everything worked fine when testing, I think that the deploying tech deployed with a USB key, so the script simply did not apply, I am still trying to find out what happened.

    I would prefer to do all of it with MDT (currently integrated with my SCCM 2012) however I have some complex scenario.

  5. We are consolidating and renaming, I have a script which does not seem to work:

    We want to base the OSDComputerNAme based on the current hostname, not where the computer is deployed from.

    Here is the script

    <><><><><>

    'On Error Resume Next
    Dim strComputer, newName
    Set objNetwork = CreateObject("Wscript.Network")
    strComputer = objNetwork.ComputerName
    Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    Set colSMBIOS = objWMIService.ExecQuery ("Select * from Win32_SystemEnclosure")
    For Each objSMBIOS in colSMBIOS
    'wscript.echo strComputer & " " & objSMBIOS.SerialNumber
    Select Case UCase(Left(strComputer,2))
    Case "NY" newName = "HQ-" & objSMBIOS.SerialNumber
    Case "NI" newName = "HQ-" & objSMBIOS.SerialNumber
    Case "NM" newName = "HQ-" & objSMBIOS.SerialNumber
    Case "LA" newName = "WE-" & objSMBIOS.SerialNumber
    Case "AZ" newName = "WE-" & objSMBIOS.SerialNumber
    End Select
    wscript.echo newName
    SET env = CreateObject("Microsoft.SMS.TSEnvironment")
    env("OSDComputerName") = NewName
    Next
    <><><><><><>
    Any help greatly appreciated.
    Thank you.
  6. Hi all

     

    I have a unique situation, here is what i would like to do, unfortunatley not too skilled with PS.

    Every time a message ID 10800 is generated

    (10800 Informational Advanced Client The SMS Advanced client was installed. The current version is %1.)

    i would like to check for the left 3 characters of the computer and based on that add it to a specific collection. the collection is a direct membership with OSDAllowed = False, so no one can deploy to that system by mistake.

    Any help on how to do this greatly appreciated.

    Update:

    I actually had to use 10804, which is when the client is assigned. I am sure there is a way for a nicer and cleaner code :-(

    <>

     

    <#
    Add every new XP client computer to the relevant Site-NoOSD collection based on its name
    and filter rule, Genrating message ID 10800, and than 10804, site assigned.
    #>
    # Import the SCCM server moudle when testing outside SCCM Server
    #import-module 'C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1'
    Set-Location HQ1:
    # SCCM Server
    # $CMServerName = "HQCM01"
    # Get the new device name from the Filter message
    $DeviceName = $args[0]
    # Collections to use
    $HQCollectionName = "HQ NO OSD"
    $NYCollectionName = "NY NO OSD"
    $LACollectionName = "LA NO OSD"
    # Get the left three characters of the computer name
    $a= hostname
    $a=$a.Substring(0,3)
    # Add to the NoOSD site-Collection
    If ($a -eq "HQ-") {Add-CMDeviceCollectionDirectMembershipRule -CollectionName "$HQCollectionName" -ResourceID $(get-cmdevice -name "$DeviceName").ResourceID}
    elseif ($a -eq "LA-") {Add-CMDeviceCollectionDirectMembershipRule -CollectionName "$LACollectionName" -ResourceID $(get-cmdevice -name "$DeviceName").ResourceID}
    elseif ($a -eq "NY-"){Add-CMDeviceCollectionDirectMembershipRule -CollectionName "$NYCollectionName" -ResourceID $(get-cmdevice -name "$DeviceName").ResourceID}
    else {write-host "Not a known site client"}

    <>

    In the filter, script.ps1 %msgsys

  7. CM 2012 SP 1, MDT integrated.

    We have laptops running PGP. We do not need to run USMT, so no issue here, we want to "simply" refresh by deleting the current XP partition and install W7. I am able to by pass boot guard with the PGPWDE command, but cannot get the delete the partition, not even with the custom PE.

    Any help greatly appreciated.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.