Command line unattended Install SCCM 2012R2 Site server

Console:

consolesetup.exe /q TargetDir=C:\Program Files\ConfigMgr EnableSQM=0 DefaultSiteServerName=<FQDN>

Install Primary Site Server

Place the setup.ini in a folder.

setup.exe /script <path\setup.ini> (run as admin)

 

Content of Setup.ini

[Identification]
Action=InstallPrimarySite

[Options]

ProductID=XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
SiteCode=<Site Code>
SiteName=<Site Name>
SMSInstallDir=<ConfigMgr install folder path>
SDKServer=<FQDN for SDKServer>
RoleCommunicationProtocol=HTTPorHTTPS
ClientsUsePKICertificate=0
PrerequisiteComp=0
PrerequisitePath=<Prereqs folder path>
MobileDeviceLanguage=0
ManagementPoint=<FQDN MP server>
ManagementPointProtocol=HTTP
DistributionPoint=<FQDN DP server>
DistributionPointProtocol=HTTP
DistributionPointInstallIIS=0
AdminConsole=1 (0 is you don’t want to install the console)

[SQLConfigOptions]
SQLServerName=<FQDN SQL server machine>
DatabaseName=<SQLServerName\InstanceName> (leave blank for the default instance)
SQLSSBPort=4022

 

more information about the parameters in the setup.ini

 

Advertisements

Extend AD SCHEMA for SCCM (2012R2)

– Log in to the DC.
– Browse to the ISO of SCMM.
– Run configmgr2012R2\smssetup\bin\x64\extadsch.exe.
– C:\extadsch.log is the place of the extend logfile.
– Start ADSIEdit.
– Add container in the System container. Value: System Management.
– Open AD Users and computers(dsa.msc)
– Select advanced view
– Browse to system/System Management
– Go to properties of System Management
– Add computer account of Primary Site server(s). Full control. This object and al descendant objetcs

Ready for Primary site installation 🙂

Windows Updates DISM automated Script

To apply updates to an offline install.wim

Powershell script:

$UpdatesPath = “C:\temp\WIMDISM\W2K8\*\*”
$MountPath = “C:\temp\WIMDISM\MOUNTDISM”
$WimFile = “C:\temp\WIMDISM\install.wim”

Dism.exe /Mount-Wim /WimFile:$WimFile /index:1 /Mountdir:$MountPath
$UpdateArray = Get-Item $UpdatesPath
ForEach ($Updates in $UpdateArray)
{
Dism.exe /image:$MountPath /Add-Package /Packagepath:$Updates
Start-Sleep –s 3
}
Write-Host “Updates Applied to WIM”
Start-Sleep –s 10
Dism.exe /Unmount-Wim /Mountdir:$MountPath /commit
Start-Sleep –s 10
Dism.exe /Cleanup-Wim

 Update 07-06-2014 Improved script!

 

$UpdatesPath = “C:\temp\WIMDISM\W2K8\*\*”
$UpdatesPath1 = “C:\temp\WIMDISM\W2K8\*\*\*”
$MountPath = “C:\temp\WIMDISM\MOUNTDISM”
$WimFile = “C:\temp\WIMDISM\install.wim”
$temppath = “C:\temp\WIMDISM\Temp”
$ItemUpdatesPath = Get-ChildItem -file $UpdatesPath
$ItemUpdatesPath1 = Get-ChildItem -file $UpdatesPath1
$UpdateArray = $ItemUpdatesPath, $ItemUpdatesPath1
ForEach ($Updates in $UpdateArray)
{
Copy $Updates $temppath
}
Write-Host “All files copied to Temp dir”
Start-Sleep –s 10

Dism.exe /Mount-Wim /WimFile:$WimFile /index:1 /Mountdir:$MountPath
Write-Host “WIM Mounted”
Start-Sleep –s 10

Dism.exe /image:$MountPath /Add-Package /Packagepath:$temppath
Start-Sleep –s 10
Write-Host “Updates Applied to WIM”
Dism.exe /Unmount-Wim /Mountdir:$MountPath /commit
Dism.exe /Cleanup-Wim

Write-Host “Saved and Cleaned up WIM”
Start-Sleep –s 10
Del C:\temp\WIMDISM\Temp\*
Write-Host “Deleted Temp files”
Write-Host “Done”

 

If you have Image X on your laptop(or get it with GetWaikTools!) use could use the following command to compress the image

<path>\imagex.exe /compress maximum /export <path>\install.wim 1 <path>\export.wim

PVS TargetOSOptimizer

Run Target OS Optimizer before capturing vDisk.

C:\Program Files\Citrix\Provisioning Services\TargetOSOptimizer.exe

 

Regfile contains:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\Software\Citrix\ProvisioningServices]
“DeviceOptimizerRun”=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\NetCache]
“Enabled”=dword:00000000
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update]
“AUOptions”=dword:00000001
“ScheduledInstallDay”=dword:00000000
“ScheduledInstallTime”=dword:00000003
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\wuauserv]
“Start”=dword:00000004
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Dfrg\BootOptimizeFunction]
“Enable”=”N”
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\OptimalLayout]
“EnableAutoLayout”=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem]
“NtfsDisableLastAccessUpdate”=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Power]
“HibernateEnabled”=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CrashControl]
“CrashDumpEnabled”=dword:00000000
“LogEvent”=dword:00000000
“SendAlert”=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\cisvc]
“Start”=dword:00000004
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
“NoRecycleFiles”=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application]
“MaxSize”=dword:00010000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security]
“MaxSize”=dword:00010000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\System]
“MaxSize”=dword:00010000
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\Cache\Content]
“CacheLimit”=dword:00000400
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Cache\Content]
“CacheLimit”=dword:00000400
[HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\Cache\Content]
“CacheLimit”=dword:00000400
[HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Cache\Content]
“CacheLimit”=dword:00000400
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Cache\Paths]
“Paths”=dword:00000004
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Cache\Paths\path1]
“CacheLimit”=dword:00000100
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Cache\Paths\path2]
“CacheLimit”=dword:00000100
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Cache\Paths\path3]
“CacheLimit”=dword:00000100
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Cache\Paths\path4]
“CacheLimit”=dword:00000100
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management]
“ClearPageFileAtShutdown”=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters]
“DisablePasswordChange”=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SysMain]
“Start”=dword:00000004
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinDefend]
“Start”=dword:00000004
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
“Windows Defender”=hex(2):00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WSearch]
“Start”=dword:00000004

SCCM Client Scan actions

SCCM Client Force Full Scan on Next schedule
Hardware Inventory
WMIC /namespace:\\root\ccm\invagt path inventoryActionStatus where InventoryActionID=”{00000000-0000-0000-0000-000000000001}” DELETE /NOINTERACTIVE

Software Inventory
WMIC /namespace:\\root\ccm\invagt path inventoryActionStatus where InventoryActionID=”{00000000-0000-0000-0000-000000000002}” DELETE /NOINTERACTIVE

Update scan
WMIC /namespace:\\root\ccm\invagt path inventoryActionStatus where InventoryActionID=”{00000000-0000-0000-0000-000000000113}” DELETE /NOINTERACTIVE

 Trigger Update scan:

WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule “{00000000-0000-0000-0000-000000000113}” /NOINTERACTIVE

Trigger Hardware Inventory:
WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule “{00000000-0000-0000-0000-000000000001}” /NOINTERACTIVE

Trigger Software Inventory:
WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule “{00000000-0000-0000-0000-000000000002}” /NOINTERACTIVE

Other:
{00000000-0000-0000-0000-000000000001} Hardware Inventory
{00000000-0000-0000-0000-000000000002} Software Inventory
{00000000-0000-0000-0000-000000000003} Discovery Inventory
{00000000-0000-0000-0000-000000000010} File Collection
{00000000-0000-0000-0000-000000000011} IDMIF Collection
{00000000-0000-0000-0000-000000000012} Client Machine Authentication
{00000000-0000-0000-0000-000000000021} Request Machine Assignments
{00000000-0000-0000-0000-000000000022} Evaluate Machine Policies
{00000000-0000-0000-0000-000000000023} Refresh Default MP Task
{00000000-0000-0000-0000-000000000024} LS (Location Service) Refresh Locations Task
{00000000-0000-0000-0000-000000000025} LS (Location Service) Timeout Refresh Task
{00000000-0000-0000-0000-000000000026} Policy Agent Request Assignment (User)
{00000000-0000-0000-0000-000000000027} Policy Agent Evaluate Assignment (User)
{00000000-0000-0000-0000-000000000031} Software Metering Generating Usage Report
{00000000-0000-0000-0000-000000000032} Source Update Message
{00000000-0000-0000-0000-000000000037} Clearing proxy settings cache
{00000000-0000-0000-0000-000000000040} Machine Policy Agent Cleanup
{00000000-0000-0000-0000-000000000041} User Policy Agent Cleanup
{00000000-0000-0000-0000-000000000042} Policy Agent Validate Machine Policy / Assignment
{00000000-0000-0000-0000-000000000043} Policy Agent Validate User Policy / Assignment
{00000000-0000-0000-0000-000000000051} Retrying/Refreshing certificates in AD on MP
{00000000-0000-0000-0000-000000000061} Peer DP Status reporting
{00000000-0000-0000-0000-000000000062} Peer DP Pending package check schedule
{00000000-0000-0000-0000-000000000063} SUM Updates install schedule
{00000000-0000-0000-0000-000000000071} NAP action
{00000000-0000-0000-0000-000000000101} Hardware Inventory Collection Cycle
{00000000-0000-0000-0000-000000000102} Software Inventory Collection Cycle
{00000000-0000-0000-0000-000000000103} Discovery Data Collection Cycle
{00000000-0000-0000-0000-000000000104} File Collection Cycle
{00000000-0000-0000-0000-000000000105} IDMIF Collection Cycle
{00000000-0000-0000-0000-000000000106} Software Metering Usage Report Cycle
{00000000-0000-0000-0000-000000000107} Windows Installer Source List Update Cycle
{00000000-0000-0000-0000-000000000108} Software Updates Assignments Evaluation Cycle
{00000000-0000-0000-0000-000000000109} Branch Distribution Point Maintenance Task
{00000000-0000-0000-0000-000000000110} DCM policy
{00000000-0000-0000-0000-000000000111} Send Unsent State Message
{00000000-0000-0000-0000-000000000112} State System policy cache cleanout
{00000000-0000-0000-0000-000000000113} Scan by Update Source
{00000000-0000-0000-0000-000000000114} Update Store Policy
{00000000-0000-0000-0000-000000000115} State system policy bulk send high
{00000000-0000-0000-0000-000000000116} State system policy bulk send low
{00000000-0000-0000-0000-000000000120} AMT Status Check Policy
{00000000-0000-0000-0000-000000000121} Application manager policy action
{00000000-0000-0000-0000-000000000122} Application manager user policy action
{00000000-0000-0000-0000-000000000123} Application manager global evaluation action
{00000000-0000-0000-0000-000000000131} Power management start summarizer
{00000000-0000-0000-0000-000000000221} Endpoint deployment reevaluate
{00000000-0000-0000-0000-000000000222} Endpoint AM policy reevaluate
{00000000-0000-0000-0000-000000000223} External event detection

Monitor PVS server Read usage

PVS uses Microsoft Windows caching mechanism for the vDisks.

Monitors the cache hits % for a percentage of hits that are from cache.

Monitor streamprocess for IO/S

 

 

Start performance monitor

Add counters:

Monitor Cache/Copy read hits %

Process(StreamProcess)\IO Data Operations/sec

Citrix PVS 7.1 Powershell

 

On a PVS Server

Install PSSnapIn(64)

C:\Windows\Microsoft.NET\Framework64\v2.0.50727\InstallUtil.exe “C:\Program Files\Citrix\Provisioning Servi
ces Console\McliPSSnapIn.dll”

Load McliPSSnapIn

Add-PSSnapin -Name McliPSSnapIn

Commands 

Device info:

Mcli-Get -Type device | Select-String -Pattern deviceName

Mcli-Get -Type device -p devicename=<Name>

Mcli-get Deviceinfo -p collectionId=<ID> | Select-String ‘(diskversion:|deviceName:|diskFileName)’

Mcli-get Deviceinfo -p collectionId=<ID -f DeviceName, active,
diskLocatorName