Jump to content


Menixmatrix

Established Members
  • Posts

    3
  • Joined

  • Last visited

About Menixmatrix

  • Birthday 06/06/1970

Profile Information

  • Gender
    Male
  • Location
    The Netherland

Menixmatrix's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Try to load the TS with command support enable, then before you start the TS hit F8 and in the CMD type TIME and correct the time once, do the same for DATE and reboot the PC. It works for me!
  2. Yes, it is not working! I believe that he doesn't see the wireless network card (I add the drivers in the WinPE and I put the PS after the drivers and before the setup windows and configmgr)
  3. Hi Niall, My organization use to name the computers after the mac address of the pc's. This is done by CustomSetting.ini file [OSDComputername=DP#Right(Replace("MACADDRESS%",":",""),12#] LP for laptops and TB for tablets. We are in the status where we want to move the OSD from MDT to our SCCM 2012 r2 cu3. Tablets are a different story, if you image multiple tablets with the same docking station you will get the same name for all of them, and we don't want that. For this we use a Power-shell script to rename the tablets to the wireless mac address (we do not have wireless access network in our organization), we use this because the mac address is unique and very handy when you have 70000 pc's to maintain. In our MDT task sequence, we put the script in State Restore/custom folder and he works perfect. My question is: Where I can put this script in your TS to make it working? Here is my PS script: ---------------------------------------------- Function Get-OSCNetAdapterProperty { #.EXTERNALHELP Get-OSCNetAdapterProperty-Help.xml [cmdletbinding()] [OutputType([system.Management.Automation.PSCustomObject])] Param ( #Define parameters [Parameter(Mandatory=$false,Position=1)] [string[]]$Name, [Parameter(Mandatory=$false,Position=2)] [string[]]$Property, [Parameter(Mandatory=$false)] [switch]$IncludeHidden, [Parameter(Mandatory=$false)] [switch]$Physical, [Parameter(Mandatory=$false)] [switch]$AllProperties ) Process { $results = @() $netAdapterPropertyNames = @{} $netAdapterAdvPropertyNames = @{} $netAdapterAdvPropertyKVP = @{} #Get Network Adapters and Advanced Properties if ($Name -ne $null) { $netAdapters = Get-NetAdapter -Name $Name -IncludeHidden:$IncludeHidden -Physical:$Physical -ErrorAction:Stop $netAdapterAdvProperties = Get-NetAdapterAdvancedProperty -Name $Name -IncludeHidden:$IncludeHidden -AllProperties:$AllProperties } else { $netAdapters = Get-NetAdapter -IncludeHidden:$IncludeHidden -Physical:$Physical -ErrorAction:Stop $netAdapterAdvProperties = Get-NetAdapterAdvancedProperty -IncludeHidden:$IncludeHidden -AllProperties:$AllProperties } if ($netAdapters -ne $null) { #Populate nested hash table: $netAdapterAdvPropertyKVP foreach ($netAdapterAdvProperty in $netAdapterAdvProperties) { $netAdapterName = $netAdapterAdvProperty.Name $netAdapterAdvPropertyDisplayName = $netAdapterAdvProperty.DisplayName $netAdapterAdvPropertyDisplayValue = $netAdapterAdvProperty.DisplayValue if (-not $AllProperties) { if (-not $netAdapterAdvPropertyKVP.ContainsKey($netAdapterName)) { $netAdapterAdvPropertyKVP.Add($netAdapterAdvProperty.Name,@{$netAdapterAdvPropertyDisplayName=$netAdapterAdvPropertyDisplayValue}) } else { $netAdapterAdvPropertyKVP[$netAdapterName].Add($netAdapterAdvPropertyDisplayName,$netAdapterAdvPropertyDisplayValue) } } else { $netAdapterAdvPropertyRegistryKeyword = $netAdapterAdvProperty.RegistryKeyword $netAdapterAdvPropertyRegistryValue = $netAdapterAdvProperty.RegistryValue if (-not $netAdapterAdvPropertyKVP.ContainsKey($netAdapterName)) { if ($netAdapterAdvPropertyDisplayName -ne $null) { $netAdapterAdvPropertyKVP.Add($netAdapterAdvProperty.Name,@{$netAdapterAdvPropertyDisplayName=$netAdapterAdvPropertyDisplayValue}) } else { $netAdapterAdvPropertyKVP.Add($netAdapterAdvProperty.Name,@{$netAdapterAdvPropertyRegistryKeyword=$netAdapterAdvPropertyRegistryValue}) } } else { if ($netAdapterAdvPropertyDisplayName -ne $null) { $netAdapterAdvPropertyKVP[$netAdapterName].Add($netAdapterAdvPropertyDisplayName,$netAdapterAdvPropertyDisplayValue) if (-not $netAdapterAdvPropertyKVP[$netAdapterName].ContainsKey($netAdapterAdvPropertyDisplayName)) { $netAdapterAdvPropertyKVP[$netAdapterName].Add($netAdapterAdvPropertyRegistryKeyword,$netAdapterAdvPropertyRegistryValue) } } else { $netAdapterAdvPropertyKVP[$netAdapterName].Add($netAdapterAdvPropertyRegistryKeyword,$netAdapterAdvPropertyRegistryValue) } } } } #Preapare hash tables for property name verification $netAdapters | Get-Member -MemberType Property | %{$netAdapterPropertyNames.Add($_.Name,"")} $netAdapters | Get-Member -MemberType ScriptProperty | %{$netAdapterPropertyNames.Add($_.Name,"")} $netAdapters | Get-Member -MemberType AliasProperty | %{$netAdapterPropertyNames.Add($_.Name,"")} #If AllProperties parameter is specified, RegistryKeyword can be used as the property name. #This is because some advanced properties do not have display name. if (-not $AllProperties) { $netAdapterAdvProperties.DisplayName | Select-Object -Unique | %{$netAdapterAdvPropertyNames.Add($_,"")} } else { $netAdapterAdvProperties.DisplayName | Select-Object -Unique | %{$netAdapterAdvPropertyNames.Add($_,"")} $netAdapterAdvProperties.RegistryKeyword | Select-Object -Unique | %{ if (-not $netAdapterAdvPropertyNames.ContainsKey($_)) { $netAdapterAdvPropertyNames.Add($_,"") } } } #Parameter value verification for $Property if (-not [system.string]::IsNullOrEmpty($Property)) { foreach ($userSpecifiedProperty in $Property) { if (-not $netAdapterPropertyNames.ContainsKey($userSpecifiedProperty)) { if (-not $netAdapterAdvPropertyNames.ContainsKey($userSpecifiedProperty)) { $warningMsg = "$userSpecifiedProperty is not a valid property name." $pscmdlet.WriteWarning($warningMsg) } } } } #Get properties and generate the result foreach ($netAdapter in $netAdapters) { $netAdapterName = $netAdapter.Name $result = New-Object System.Management.Automation.PSObject #Get all properties unless specific properties are specified if (-not [system.string]::IsNullOrEmpty($Property)) { foreach ($userSpecifiedProperty in $Property) { $propertyValue = $netAdapterAdvPropertyKVP[$netAdapterName].$userSpecifiedProperty if ($netAdapterPropertyNames.ContainsKey($userSpecifiedProperty)) { $result | Add-Member -NotePropertyName $userSpecifiedProperty -NotePropertyValue $($netAdapter.$userSpecifiedProperty) -Force } elseif ($netAdapterAdvPropertyNames.ContainsKey($userSpecifiedProperty)) { $result | Add-Member -NotePropertyName "$userSpecifiedProperty" -NotePropertyValue $propertyValue -Force } } } else { foreach ($netAdapterProperty in $netAdapterPropertyNames.Keys.GetEnumerator()) { $result | Add-Member -NotePropertyName $netAdapterProperty -NotePropertyValue $($netAdapter.$netAdapterProperty) -Force } foreach ($netAdapterAdvPropertyName in $netAdapterAdvPropertyNames.Keys.GetEnumerator()) { $propertyValue = $netAdapterAdvPropertyKVP[$netAdapterName].$netAdapterAdvPropertyName $result | Add-Member -NotePropertyName $netAdapterAdvPropertyName -NotePropertyValue $propertyValue -Force } } $results += $result } } return $results } } $strFile = "C:\temp\mac.csv" IF(-not (test-path -Path c:\temp)){New-Item -type directory -Path c:\temp} # Get details of this computer $MacAddressOrg = Get-OSCNetAdapterProperty -Name "Wi-Fi" -AllProperties -Property "LinkLayerAddress" | Export-Csv $strFile -NoTypeInformation # Clean Text file (Get-Content $strFile) | ForEach-Object {($_ -replace "-", "")} | ForEach-Object {($_ -replace "LinkLayerAddress", "")} | ForEach-Object {($_ -replace """", "")} | Set-Content $strFile $MacAddress = Get-Content -Path $strFile | Select-Object -Index 1 Write-Host MACAdress = $MacAddress $strTabletComputerName = "TB$MacAddress" Write-Host ComputerName = $strTabletComputerName Rename-Computer -NewName $strTabletComputerName --------------------------------------------------------------------------------------------------- If I manually run this script after the image process, it will work. I need this to be inside the TS process. Please help I already try all I can thing like in the end of State Restore 1. Just run the PS1 2. Apply Windows Settings then PS1 then reboot 3. etc
×
×
  • 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.