Showing posts with label sccm. Show all posts
Showing posts with label sccm. Show all posts
Monday, September 5, 2016
Heres a Script PowerShell to duplicate Package on SCCM 2012
Heres a Script PowerShell to duplicate Package on SCCM 2012
Before Modify any Package on Production, take time to duplicate it.
Its a part of Best Practice, to duplicate a package befor modifing them.

Heres a Script PowerShell to duplicate Package on SCCM 2012
#------------------------
$ServerSCCM = "SCCMTest"
Import-Module $ServerSCCMd$Program FilesMicrosoft Configuration ManagerAdminConsole inConfigurationManager.psd1
$pkgID = FR100F40
$packageDestination = "ShareSoftRepository_Serveurs1. UATPackages"
$PackageList = @(gwmi -ComputerName $ServerSCCM -Namespace rootsmssite_FR1 -class SMS_Package -filter "PackageID=$pkgID")
if ( $PackageList.count -gt 0 ) {
foreach ( $package in $PackageList )
{
#Store name and location of package
$pName = $package.name
$pLocation = $package.PkgSourcePath
#Extract folder name of package
$folderName =$pLocation.Substring($pLocation.LastIndexOf("")+1)
Write-Host "Package to duplicate : " $pName
#Copie sources
Copy-Item $pLocation $packageDestination -recurse
#acces to SCCM site
cd "$((Get-PSDrive -PSProvider CMSite).Name):"
$ProgramList = Get-CMProgram -PackageId $pkgID
#Create a copie of package
$newPackage = New-CMPackage -Name "$pName - copie" -Path "$packageDestination$folderName"
#add programes
foreach ( $Program in $ProgramList )
{
$np = New-CMProgram -PackageName "$pName - copie" -CommandLine $Program.CommandLine -StandardProgramName $Program.ProgramName
#Copie program Proreities
$np.ProgramFlags = $Program.ProgramFlags
#Commit changes
$np.put()
}
}
}
Its a part of Best Practice, to duplicate a package befor modifing them.

Heres a Script PowerShell to duplicate Package on SCCM 2012
#------------------------
$ServerSCCM = "SCCMTest"
Import-Module $ServerSCCMd$Program FilesMicrosoft Configuration ManagerAdminConsole inConfigurationManager.psd1
$pkgID = FR100F40
$packageDestination = "ShareSoftRepository_Serveurs1. UATPackages"
$PackageList = @(gwmi -ComputerName $ServerSCCM -Namespace rootsmssite_FR1 -class SMS_Package -filter "PackageID=$pkgID")
if ( $PackageList.count -gt 0 ) {
foreach ( $package in $PackageList )
{
#Store name and location of package
$pName = $package.name
$pLocation = $package.PkgSourcePath
#Extract folder name of package
$folderName =$pLocation.Substring($pLocation.LastIndexOf("")+1)
Write-Host "Package to duplicate : " $pName
#Copie sources
Copy-Item $pLocation $packageDestination -recurse
#acces to SCCM site
cd "$((Get-PSDrive -PSProvider CMSite).Name):"
$ProgramList = Get-CMProgram -PackageId $pkgID
#Create a copie of package
$newPackage = New-CMPackage -Name "$pName - copie" -Path "$packageDestination$folderName"
#add programes
foreach ( $Program in $ProgramList )
{
$np = New-CMProgram -PackageName "$pName - copie" -CommandLine $Program.CommandLine -StandardProgramName $Program.ProgramName
#Copie program Proreities
$np.ProgramFlags = $Program.ProgramFlags
#Commit changes
$np.put()
}
}
}
Available link for download
Thursday, September 1, 2016
SCCM Create user collection based on Active directory groups
SCCM Create user collection based on Active directory groups
To create a user collection based on Active directory (AD) groups, with SCCM 2012 you should :
1-Enable the folwing Discovery Methodes :





1-Enable the folwing Discovery Methodes :
- Active Directory Group Discovery
- Active Directory User Discovery

2- On System configuration Manager 2012 , or SCCM 2012 R2 Go to "Assets and ComplianceOverviewUser Collections" and right click , then chose create user collection

3- Put the correct information (Name, et limiting collecion)

4-Add a Querry Rule

5- CLik on Edit Query Statement, then SHow Query language
6- Put the query :
select SMS_R_USER.ResourceID,SMS_R_USER.ResourceType,SMS_R_USER.Name,SMS_R_USER.UniqueUserName,SMS_R_USER.WindowsNTDomain from SMS_R_User where UserGroupName like %Name of Ad Groupe %

Click ok then enjoy!!
Available link for download
Monday, August 22, 2016
Solution Pxe aborted booting next device sccm 2012
Solution Pxe aborted booting next device sccm 2012
There different solution to fix the issue "Pxe aborted booting next device" when you deploy Windows 10 using SCCM 2012.
you have to validate that all machine to deploy with Windows 10 are on the collection targeted
by the deployment


1- Tchek if the machine is know on SCCM and its placed on the correct SCCM Collecion :
If you deploy windows 10 task sequence only on known computer; or on a specifique collection,you have to validate that all machine to deploy with Windows 10 are on the collection targeted
by the deployment

2-Tech that the Machine is note obselete :
Maybe there are severel copie of the same machine on sccm 2012, so you have select the obselete one. So tchek thate the value of "Obselete" equalea No
If the value of "Obselete" equale to "YES" you have to delte the machine and importe them to get a valid statut and a correct GUID
3- There a A required PXE Deploymennts
The moste of time, "Pxe aborted booting next device " is caused by a privouse delpyement still required on the machine , so right click on the computer and chose "Clear Required PXE Deployments"

4-Be sure that all contente "Packages, Applications , drivers..ect" of Windows 10 deployment task sequence are distributed on all distribution points
Yes, somtimes we forgot to distribute only one item of TS and its sufisant to get many windows 10 deployements issues.....
So to be sure that all contente of Windows 10 deployment task sequence are distributed, right click on the task sequence and chose "Distribute Contente", this will distribute all contente of ts

5- Did you chose the coorect Boot wim ?
We cant deploy a task sequence without a correct boot wim.. so tcheck that your TS use the correct Boot wim on the proprities of TS, and its available for PXE, and finaaly if the boot wim is distributed on dps.

Available link for download
Saturday, August 20, 2016
Exclude a Mac Address from SCCM DDRs Reuse the same NIC for multiple PXE
Exclude a Mac Address from SCCM DDRs Reuse the same NIC for multiple PXE
Reuse the same NIC for multiple PXE

In order to reuse the same NIC for multiple PXE (such as OSD on sur Surface Pro using a single USB to Ethernet adapter), you have to exclude to MAC address.
Why you have to do that? the answer is simple! if a device is registered with the mac address of the USB to Ethernet adapter, this usb Network cant be used on additional devices to deploy windows using PXE boot.
To fix this issue you have to exclude the MAC address of usb to Ethernet Adapter by modifying the following registry Key:
HKEY_LOCAL_MACHINESOFTWAREMicrosoftSMSComponents SMS_DISCOVERY_DATA_MANAGER
Edit the value of ExcludeMACAddress and add the Mac address with the appropriate format (letters in uppercase and the: char after all to digits ex such as 50:2A:C6:FE:AA:9C

This Registry Key must be modified on SCCM primary server.
Available link for download
Sunday, August 7, 2016
SCCM client Failed to recreate client evaluation task
SCCM client Failed to recreate client evaluation task
SCCM 2012R2 client that was reported as client that failed check from All Desktop and Server clients. The error message was Failed to recreate client evaluation task :

Connect to the client host and check "Task Scheduler" service

After setting the Task Scheduler service to Automatic and starting the service, and restarting the SMS Agent Host service the Configuration Manager Health Evaluation task will be successfully created and the client will no longer report as client that failed check.
Connect to the client host and check "Task Scheduler" service
After setting the Task Scheduler service to Automatic and starting the service, and restarting the SMS Agent Host service the Configuration Manager Health Evaluation task will be successfully created and the client will no longer report as client that failed check.
Available link for download
Thursday, August 4, 2016
Script powerShell to create user Category for catalogue SCCM 2012
Script powerShell to create user Category for catalogue SCCM 2012
You have a list of category to implemente on System configurqtion Manager 2012 r2.
Heres a script powershell that will do it for you :

Function Create-AdministrativeCategory
{
[CmdLetBinding()]
Param(
[Parameter(Mandatory=$True,HelpMessage="Please Enter Category Name")]
$CategoryInstanceName
)
$SiteCode = "Site code"
$SiteServer = "SCCM Server"
#New GUID for the Category
$GUID = [GUID]::NewGuid().ToString()
#Create the SMS_Category_LocalizedProperties property
$NewCat = ([WMIClass]"$SiteServer ootSMSSite_$($SiteCode):SMS_Category_LocalizedProperties").CreateInstance()
$NewCat.CategoryInstanceName = $CategoryInstanceName
$NewCat.LocaleID = 0
#Create the New Category Instance
$Arguments = @{CategoryTypeName = "CatalogCategories"; LocalizedInformation = [ARRAY]$NewCat; SourceSite = $SiteCode;CategoryInstance_UniqueID = "CatalogCategories:$GUID"}
Try{
Set-WmiInstance -Namespace "RootSMSSite_$SiteCode" -Class "SMS_CategoryInstance" -ComputerName $SiteServer -Arguments $Arguments
}
Catch{
$_.Exception.Message
}
}
#List of category to add for web catalog
$PrdAppList = @("Free application","Windows 10 Applications","Virtual applications","Windows 7 to windows 10","Licenced applications","Downloaded applications","Iphone applications","Adroid applications","Windows Phone applications","Microsoft Applications","Security Applications")
foreach ($PrdApp in $PrdAppList)
{
Create-AdministrativeCategory -CategoryInstanceName $PrdApp
}
Heres a script powershell that will do it for you :

Function Create-AdministrativeCategory
{
[CmdLetBinding()]
Param(
[Parameter(Mandatory=$True,HelpMessage="Please Enter Category Name")]
$CategoryInstanceName
)
$SiteCode = "Site code"
$SiteServer = "SCCM Server"
#New GUID for the Category
$GUID = [GUID]::NewGuid().ToString()
#Create the SMS_Category_LocalizedProperties property
$NewCat = ([WMIClass]"$SiteServer ootSMSSite_$($SiteCode):SMS_Category_LocalizedProperties").CreateInstance()
$NewCat.CategoryInstanceName = $CategoryInstanceName
$NewCat.LocaleID = 0
#Create the New Category Instance
$Arguments = @{CategoryTypeName = "CatalogCategories"; LocalizedInformation = [ARRAY]$NewCat; SourceSite = $SiteCode;CategoryInstance_UniqueID = "CatalogCategories:$GUID"}
Try{
Set-WmiInstance -Namespace "RootSMSSite_$SiteCode" -Class "SMS_CategoryInstance" -ComputerName $SiteServer -Arguments $Arguments
}
Catch{
$_.Exception.Message
}
}
#List of category to add for web catalog
$PrdAppList = @("Free application","Windows 10 Applications","Virtual applications","Windows 7 to windows 10","Licenced applications","Downloaded applications","Iphone applications","Adroid applications","Windows Phone applications","Microsoft Applications","Security Applications")
foreach ($PrdApp in $PrdAppList)
{
Create-AdministrativeCategory -CategoryInstanceName $PrdApp
}
Available link for download
Subscribe to:
Posts (Atom)