IT Consultant Everyday Notes

Just some problems/solutions storage

Monthly Archives: February 2016

SCCM: How to extract drivers from an existing machine for later OSD

Michael published a quick-cheat for that. You can extract drivers to a folder, import them to SCCM or MDT and deploy back to bare-metal machines.

 

powershell command is:

Export-WindowsDriver -Destination “C:\Drivers\$((Get-WmiObject -Class win32_computersystem).Model)” -Online

 

more details here: http://deploymentbunny.com/2016/02/26/powershell-is-king-export-drivers-from-windows/

Advertisements

SCCM: OSD tattoo script

Jason Sandys  published a nice script for tattoing imaged machines.

Azure: Migrate an Azure VM v2 (ARM-based) between two storage accounts

One of my Customers asked me to move some VMs from expensive Premium storage account to a cheaper Standard tier.

The infrastructure was built using Resource Mode and luckily we do not need to convert VHDs to OS disks (as it is required for Classic VMs).

1. I shutdown/deprovision VM (you do not need to delete it)

2. Copy VHD OS disk and data disk to the new storage account

3. Recreate VM at the new place using the following script:

Login-AzureRmAccount
select-azurermsubscription -SubscriptionName “My Subscription”

$rgName=”Resourcegroupname”
$locName=”EastUS”
$vnetName=”vnet_name”

# to check subnet index use:   Get-AzureRmVirtualNetwork -Name msps –ResourceGroupName $rgName | Select Subnets
$subnetIndex=1
$name=”yourvmname”

$vnet=Get-AzureRmvirtualNetwork -Name $vnetName -ResourceGroupName $rgName

$vm=New-AzureRmVMConfig -VMName $name -VMSize Standard_D4
$vm | Set-AzureRmVMOSDisk -VhdUri https://*******.vhd –Name $name -CreateOption attach -Windows -Caching ReadWrite

$vm | Add-AzureRMVMDataDisk -Name “XXXX-data” -VhdUri https://*****-data01.vhd -LUN 0 -Caching ReadWrite -CreateOption Attach -DiskSizeinGB 1023

$nicName= $name + “_nic”
$pipName= $name + “_pip”
$domName= $name
$pip=New-AzureRmPublicIpAddress -Name $pipName –ResourceGroupName $rgName-DomainNameLabel $domName -Location $locName -AllocationMethod Dynamic
$nic=New-AzureRmNetworkInterface -Name $nicName –ResourceGroupName $rgName-Location $locName -SubnetId $vnet.Subnets[$subnetIndex].Id -PublicIpAddressId $pip.Id -PrivateIpAddress $privIP
$vm=Add-AzureRmVMNetworkInterface -VM $vm  -Id $nic.Id

New-AzureRMVM -ResourceGroupName Sharepoint -Location “East US” -VM $vm –Verbose

The machine is recreated and started

here are some useful links I used: https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-ps-create-preconfigure-windows-resource-manager-vms/

if you have a lot of numbered disks: http://sc.scomurr.com/arm-recreating-vm-off-existing-vhds/

Microsoft doc: https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-create-windows-powershell-resource-manager/

SCCM: Be careful with Windows 10 Servicing Plans!

SCCM CB (Currently 1511) supports new Windows 10 Servicing model. There is an option to create a Custom Servicing Plan an deploy it to a collection od Windows 10 Computers.

This approach is similar to Automatic Deployment Rule for regular updates. It will automatically download and put the new builds in a Deployment package.

There is a huge surprise though:  Custom Servicing Plan will download/distribute to DPs all versions of the build (different languages and Windows Editions) regardless the language you selected during the Servicing Plan creation. Each build is currently ~2GB, so it will be significant amount overall. Not sure why MS decided to to that and where is their QC. Probably it is a part of a new policy when products are pushed to the market half-backed and tuned-up after.

At this point I would recommend do not use servicing plans, but just a right-click necessary build in build list, download/distribute this and only this build to deployment package/DP and deploy it to a collection the same way we do for regular updates.

 

image

Kent Agerlund also suggested to Decline all unnecessary builds in WSUS manually, in this case you should be able to use Custom Servicing Plans.

SCCM: Reusing the same NIC for multiple PXE initiated deployments in System Center Configuration Manger OSD

Microsoft SCCM OSD support published a nice article about the subj: http://blogs.technet.com/b/system_center_configuration_manager_operating_system_deployment_support_blog/archive/2015/08/27/re_2d00_use-the-same-nic-for-multiple-pxe-initiated-deployments.aspx

 

You basically need to add MAC address of a docking station or USB NIC you use for multiple machines to SCCM Discovery exclusion via editing SCCM registry as described:

This can be done by opening Regedit on the site server and navigating to the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SMS\Components \SMS_DISCOVERY_DATA_MANAGER

followed by editing the registry value of:

ExcludeMACAddress

This registry key value is a multi-string value that is the placeholder of the list of MAC addresses to be filtered. The registry key holds one MAC address per line in the following format:

50:1A:C5:FE:AA:8C

 

Note the known computers should be introduced with GUID instead of MAC after that. Please read details in the article.

IE 11: How to use an IE Enterprise Mode site list, located on a local drive

Microsoft has a nice article about Interprise Mode implementation. https://technet.microsoft.com/en-us/library/mt270205.aspx

Unfortunately an example for a local file location is wrong. You should put the following value in your GPO:

basically:    “sitelist”=file://c:\Users\<user>\Documents\testList.xml   instead of “SiteList”=file:///c:\\Users\\<user>\\Documents\\testList.xml “ as in the article.

 

for example:

image