Script powerShell to create user Category for catalogue SCCM 2012

You have a list of category to implemente on System configurqtion Manager 2012 r2.

Here's 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\root\SMS\Site_$($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 "Root\SMS\Site_$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
}

Previous
Next Post »

4 commentaires

Click here for commentaires
8 mars 2017 à 01:11 ×

Windows 10 key Permanent Activator Download
Check here for more info
http://www.Microsoftkeysales.com/

Reply
avatar
9 mars 2017 à 17:33 ×

Just got Windows 10 Product Key from http://www.Gastonfiore.com/
And IT WORKED PERFECTLY!!!! XDDDDD
I'm so exited and wanna share this good post everywhere!!

Reply
avatar
Toby Clement
admin
15 mars 2017 à 18:22 ×

Lots of genuine office 2016 Product Key here
www.Microsoftkeyshops.com

Reply
avatar
Susan Gates
admin
22 mars 2017 à 18:37 ×

Get official Windows 10 Product Key from here:
http://www.Msofficialstore.com/
Works like a charm.

Reply
avatar