Creating an Advertisement Through Powershell SCCM 2012

Currently I'm trying to find the most efficient way to automate the package deployment process using powershell. The script I'm using at the moment is returning Message ID 100035(waiting for content) under the deployment status, and the CAS logs say
<![LOG[Requesting content SKG00054.1, size(KB) 1344, under context System with priority Low]LOG]!><time="11:18:46.382+240"
date="07-06-2012" component="ContentAccess" context="" type="1" thread="2780" file="contentaccessservice.cpp:855">
<![LOG[Submitted CTM job {1CA3F8E4-13DA-1483-9F8E-12FUL5C4E3FE}
to download Content SKG00054.1 under context System]LOG]!><time="11:18:46.413+240" date="07-06-2012" component="ContentAccess"
context="" type="1" thread="2780" file="downloadmanager.cpp:554">
<![LOG[Successfully created download  request {2CEK4BA5-FD7D-4529-A04D-95DXE98237566}
for content SKG00054.1]LOG]!><time="11:18:46.413+240" date="07-06-2012" component="ContentAccess" context=""
type="1" thread="2780" file="downloadcontentrequest.cpp:824">
<![LOG[Location update from CTM for content SSKG00054.1 and request {2CEK4BA5-FD7D-4529-A04D-95DXE98237566}]LOG]!><time="11:18:47.069+240"
date="07-06-2012" component="ContentAccess" context="" type="1" thread="2676" file="downloadcontentrequest.cpp:991">
<![LOG[Download request only, ignoring location update]LOG]!><time="11:18:47.069+240"
date="07-06-2012" component="ContentAccess" context="" type="1" thread="2676" file="downloadcontentrequest.cpp:1010">
Execmgr logs:
<![LOG[Execution Request for advert SKG200BB package SKG00054 program * state change from WaitingDependency to WaitingContent]LOG]!><time="11:18:46.601+240"
date="07-06-2012" component="execmgr" context="" type="1" thread="2676" file="executionrequest.cpp:503">
<![LOG[Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="SKG00054",ProgramID="*",
actionType 1l, value , user NULL, session 4294967295l, level 0l, verbosity 30l]LOG]!><time="11:18:46.601+240"
date="07-06-2012" component="execmgr" context="" type="1" thread="2676" file="event.cpp:410">
<![LOG[Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="SKG00054",ProgramID="*",
actionType 1l, value NULL, user NULL, session 4294967295l, level 0l, verbosity 30l]LOG]!><time="11:18:46.741+240"
date="07-06-2012" component="execmgr" context="" type="1" thread="3452" file="event.cpp:410">
I'm unsure why the advertisement isn't deploying properly, because the properties look identical to previous packages I've sent manually. One thing I may think be the issue is that I'm
adding the package to a Distribution Point Group which I know may disrupt deployments if a package has already previously been assigned to it I believe.
$sitename = "SKG"
Function create-PKGDeployment
$targetcoll = gwmi -ns "root\SMS\Site_$sitename" -class SMS_Collection | WHERE {$_.Name -eq 'Lab'}
$collID = $targetcoll.CollectionID
$collName = $targetcoll.Name
$PKG = gwmi -ns "root\SMS\Site_$sitename" -class SMS_Package | WHERE {$_.name -eq 'Firefox'}
$PKGID = $PKG.PackageID
$PKGName = $PKG.Name
$AdvName = $PKGName+"_"+$PKGID+"_"+$collName
[ARRAY]$PackageID = $PKGID;
Invoke-WmiMethod -Namespace "Root\SMS\Site_SKG" -Name AddPackages -Path "SMS_DistributionPointGroup.GroupID='{1PKU8557-9153-4C39-8DHK-DB0C53H801BA}'" `
-ArgumentList ( ,$PackageID)
$Format = get-date -format yyyyMMddHHmmss
$Date = $Format + ".000000+***"
$AdvArgs = @{
AdvertisementName = "$AdvName";
CollectionID = $collID;
PackageID = $PKGID;
SourceSite = $sitename;
ActionInProgress = 2
PresentTime = $Date
ExpirationTime = $Date
PresentTimeEnabled = $true
ProgramName = "*";
AdvertFlags = 33751072;
RemoteClientFlags = 2128;
TimeFLags = 8193
Set-WmiInstance -Class SMS_Advertisement -arguments $AdvArgs -namespace "root\SMS\Site_$sitename" | Out-Null
Create-PkgDeployment

I created advertisement. I am trying to use powershell script o change advertisement start time and mandatory time and expiry time. I am using sccm2012 r2 cu2. I can able to change advertisement start time and expiry but not mandatory through powershell
or vbscript. In our environment we have more than 50+ advertisement schedule by daily bases. Can you help me how to change mandatory assignemnent time using script or powershell
Example: Advert start time:08/08/2014 11:00AM
Expiry Time 08/09/2014 6:00AM
Mandatory time: 08/08/2014 09:00PM. If you need any more info let me know

Similar Messages

  • How to create an exclusion into an SCCM 2012 to not discover Non Windows OS

    How to create an exclusion into an SCCM 2012 to not discover Non Windows OS 

    I assume they are in your AD. In that case your only option is to not discover them by not including their OUs in your
    Active Directory System Discovery.
    My Blog: http://www.petervanderwoude.nl/
    Follow me on twitter: pvanderwoude

  • Powershell SCCM 2012 and AD collections

    Greetings everyone, I am trying to take a select of groups in a certain OU within AD to make SCCM 2012 user collections from. I been playing around with just creating the collections based upon a txt file which would work and is probably easier. Can someone
    go through this mess I have down here and make this work. I found some scripts that do what I need but they just aren't flowing together well. Thanks for any help you can give. I think the 'DOMAIN\\'$ADName isn't going to work either. Thoughts?
    import-module ($Env:SMS_ADMIN_UI_PATH.Substring(0,$Env:SMS_ADMIN_UI_PATH.Length-5) + '\ConfigurationManager.psd1')
    $PSD = Get-PSDrive -PSProvider CMSite
    CD "$($PSD):"
    $ADName = Get-Content -Path C:\fso\ADgroups.txt
    New-CMUserCollection -Name $ADName -LimitingCollectionName "All Users and User Groups" -RefreshType Both
    Add-CMUserCollectionQueryMembershipRule -CollectionName $ADName -QueryExpression "select *  from  SMS_R_User where SMS_R_User.UserGroupName = 'DOMAIN\\'$ADName" -RuleName "QueryRuleName1"

    $ADName = Get-Content -Path C:\fso\ADgroups.txt
    To add-on to Torsten, this single line gets the content of your text file and (in most cases) will create an array filled with each line of the text file. So before you can use this information, you have to loop through it to get the information of the different
    lines in your text file.
    I think you should do something like this:
    $ADNames = Get-Content -Path C:\fso\ADgroups.txt
    foreach ($ADName in $ADNames){
    <YourCollectionActions>
    My Blog: http://www.petervanderwoude.nl/
    Follow me on twitter: pvanderwoude

  • Add site system role through automation, SCCM 2012 Sp1

    hi
    Trying to add a reporting point through powershell or the SDK with no luck.
    Does any out there have any idea how to do this? We are trying to automate the process of everything.
    When adding through powershell its a sucess with the role itself, but when accessing the reporting node the console crashes and the links are missing.
    Any ideas or tips?
    Regards
    Lasse
    shaggys

    This was finally fixed in
    CU3 for SCCM 2012 R2 and I can confirm that it does work with CU4 for SCCM 2012 R2.
    One note is that the cmdlet documentation is not 100% accurate.  For example, the example listed in get-help excludes required parameters.  Also, the parameter descriptions are not descriptive enough without knowing additional information
    about the role/point.  Here is what worked for me:
    Add-CMReportingServicePoint-SiteCode$SiteCode-SiteSystemServerName$SCCMpriFQDN-DatabaseServerName$SCCMpriFQDN-DatabaseName"CM_$SiteCode"-ReportServerInstance$SCCMsqlDatabaseInstanceName -FolderName"ConfigMgr_$SiteCode"-UserName$CMAaccountConfiguredAsSSRSexecutionAccount

  • Help - No Advertisement found in SCCM 2012

    Hello, guys!
    My environment is Windows Server 2008 R2 64Bits with SCCM 2012.
    I need help with deploy SO, my log smspxe:
    00:0C:XX:XX:XX:YY, 6F5FAAAB-0000-58BC-3A32-4F80A483B5C0: device is in the database.
    No Advertisement found
    My pre-requisits set is in PXE is correct because I do deploy in other Collection, my problem is occured when i created new collection and associated new computer i have the problem I saw up.
    I enabled PXE for unknown support
    Thank's any suggestion.
    PS: I read this link but no resolution my problem
    http://social.technet.microsoft.com/Forums/systemcenter/en-US/51905bf5-0acc-4ceb-9c68-a9364e56b1f1/deploying-os-using-sccm-getting-error-processdatabasereply-no-advertisement-found-in-db-for?forum=configmgrosd

    If you look at the properties of the device do you see any Deployments on the Deployments tab?
    Also, when deploying a task sequence you have the option to chose "Make available to the following:" and it gives you 3 options:
    Only configuration manager clients
    Configuration manager clients, media and PXE
    Only media and PXE
    Only media and PXE (hidden)
    Is this configured properly so that it doesn't omit the device you are trying to image?
    Dustin Estes - MCP | www.dustinestes.com

  • Create vertual package in SCCM 2012

    I Need to create a virtual (App-v package) that I sequenced in sccm 2012. I remember in sccm 2007 there was an option (Create virtual package) I don't see that here whats the procedure for creating virtual package\application in sccm 2012
    Thanks

    I re-sequenced it Notepad++ and this time and this time I chose continue Configuring and launched Application and was able to add file association through the App, so when App was repushed file association was there for .vbs, .txt. etc...
    I have been looking at some blogs and I fond that the sequencer has a Tab Shortcuts and FTA's I don't see that Tab on my sequencer and I'm running 5.0 sp1 any thoughts on that?
    maybe ask in the dedicated App-V forum?
    https://social.technet.microsoft.com/Forums/en-US/home?forum=mdopappv
    Don
    (Please take a moment to "Vote as Helpful" and/or "Mark as Answer", where applicable.
    This helps the community, keeps the forums tidy, and recognises useful contributions. Thanks!)

  • Sccm 2012 collection query for software deployment failed PCs

    Hi,
    Let me know how can we create a collection of PCs which a particular advertisement failed.
    SCCM 2012 sp1 infra
    Midhun.PS

    See
    http://myitforum.com/cs2/blogs/gramsey/archive/2006/10/20/How-To_3A00_-Create-a-Collection-Based-on-an-Advertisement-Status.aspx. This will only work for program deployments, not applications.
    Torsten Meringer | http://www.mssccmfaq.de

  • SCCM 2012 Query to find units with IPv6 Enabled?

    We've found a need to locate computers that may have IPv6 enabled for audit purposes, and then we'll disable them at a later date.
    Has anyone been able to create a successful query in SCCM 2012 to get that information? 
    I found this but it spit back the IPv4 info for all the units in our device collection, plus it's for SCCM 2007. http://www.myitforum.com/forums/Query-for-systems-with-IPv6-enabled-m227020.aspx
    Appreciate any input, thanks!
    This topic first appeared in the Spiceworks Community

    If you're using % in the value field the operator must be "Like" . In your case, the query should look like
    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 SMS_R_User.UserPrincipalName Like
    "TQA%" order by SMS_R_User.UserPrincipalName
    Kindly mark as answer/Vote as helpful if a reply from anybody helped you in this forum. Delphin

  • SCCM 2012 Disk Space

    Hi
    I prepare to migrate SCCM 2007 to SCCM 2012, i create one server "stand -alone" (SCCM 2012), i have around 8000 clients.
    On SCCM 2007:
    Drive C: 60 Go
    Drive E:  SMSPKGE$ = 300 Go, SMSPKG = 250 Go. (Sources another server).
    Did i forget something when calculating disk space?
    Thanks

    My plan for a new server (4 vCPU, 32 Go RAM, C: 800 Go) just C: drive because SQL 2012 and sources packages on another server (source don't move), on C: drive install only OS and SCCM 2012?
    Hi,
    Your disk space is enough.
    There is a blog talks about SCCM 2012 hardware requirements. You could have a look.
    Configuration Manager 2012 Sizing considerations
    http://blogs.msdn.com/b/scstr/archive/2012/05/31/configuration_2d00_manager_2d00_2012_2d00_sizing_2d00_considerations.aspx
    Best Regards,
    Joyce
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Not liking Deployment Status Monitoring in SCCM 2012 - Not enough detail

    I know SCCM 2012 has made some fantastic changes to offering tools for deploying packages.  I am using and learning a lot about deploying apps using the new features of SCCM 2012 Application Management.  I still have a few apps that I need to deploy
    the old way using Packages.  With the old way, I liked using task sequences and conditions with WMI Queries.  One item I found out quickly is that I am having issues with SCCM 2012 recognizing some name spaces such as root\cimv2\sms.  I am still
    researching why.  The other item is reporting of advertisements or what SCCM 2012 now calls Deployments.  I am unable to find a way to get more detailed reporting on deployments that I had with SCCM 2007 using the right click tools and advertisement
    reports.  The details of these reports in SCCM 2007 was really good and I was able to troubleshoot each step of a task sequence.  All I can find with SCCM 2012 is a simple description that says the "Program completed with success" or the program
    failed.  Is there a way to easily get more detailed reports much like I had with SCCM 2007?  I know I am missing something really simple.  Any insight would be much appreciated.   
    Thanks
    BJ

    It's an old thread and all, but I'd like to add to the last post.
    Pellewall has 400 application type deployments - I feel bad for him. We've converted almost all of ours into packages, because application deployment doesn't Work as reliably as packages. We can't get applications to install in task sequences, and sometimes
    simple installs fail for wierd reasons when deployed as application, but perform fine using the same install string as a package launched thru cmd (both as system user).
    We've been using sccm 2012 for 1½ years now roughly, and I'd discourage anyone from making application type programs if they don't want a headache.
    As for reporting - the builtin reports need to be modified to become useful, but they're a nice extra to have. I find the old reporting system in 2007 was much simpler and faster than srs though, but that might just be my opinion.
    As times change, so do people.

  • Installing an application through Powershell with SCCM 2012 r2 is not working as expected

    I am trying to install a VOIP client using a powershell script. When I run the powershell script on the client in a administrative powershell prompt the script runs fine and it installs the application as expected. When I try to do the same thing through
    the SCCM client using an application it does not install.
    I am not a Powershell Guru so the script below is my simple understanding of installations through powershell as of this moment
    <#
    Installatiescript CIC Client SU6 32 bit (kantoor)
    Versie 1.3
    17 april 2015 - Uitbreiding logfile. Fix opschonen startmenu
    16 april 2015 - Aanpassing verwijderen oude client, logfile aanmaken in TEMP
    13 maart 2015 - Eerste versie
    #>
    # Bepaal installatiebron
    $SourceDir = "\\VSC0501\SetupShare\APP_IC_Client_SU6\x86"
    # Bepaal logvariabelen
    $logfile = "$env:TEMP\cic_su6-install.txt"
    $Logdate = get-date -f yyyyMMdd-HHmm
    # Controleer of oude CIC client aanwezig is (versie 4.04.316) en deinstalleer deze indien nodig
    If (Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{543BE3AC-426D-4FDD-8160-ECEEC2E211B6}")
    $val = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{543BE3AC-426D-4FDD-8160-ECEEC2E211B6}").DisplayVersion
    if($val -eq "4.04.316") {
    $process = Start-Process -Filepath "msiexec.exe" -Argumentlist "/x {3F20671C-9CA2-41FA-B94A-C7C7FD95C7B4} /QN" -Wait -Passthru
    if ($process.ExitCode -eq 0) {
    Write-Output "$logdate - Client has been succesfully removed" | out-file $logfile -Append
    else {
    Write-Output "$logdate - Client cannot be succesfully removed" | out-file $logfile -Append
    exit
    $process = Start-Process -Filepath "msiexec.exe" -Argumentlist "/x {543BE3AC-426D-4FDD-8160-ECEEC2E211B6} /QN" -Wait -Passthru
    if ($process.ExitCode -eq 0) {
    Write-Output "$logdate - Client has been succesfully removed" | out-file $logfile -Append
    else {
    Write-Output "$logdate - Client cannot be succesfully removed - " $process.ExitCode | out-file $logfile -Append
    exit
    #(Start-Process -Filepath "msiexec.exe" -Argumentlist "/x {3F20671C-9CA2-41FA-B94A-C7C7FD95C7B4} /QN" -Wait -Passthru).exitcode
    #(Start-Process -Filepath "msiexec.exe" -Argumentlist "/x {543BE3AC-426D-4FDD-8160-ECEEC2E211B6} /QN" -Wait -Passthru).exitcode
    Get-ChildItem "$env:SYSTEMDRIVE\ProgramData\Microsoft\Windows\Start Menu\Programs\Abvakabo FNV\Interactive Intelligence" | Remove-Item -Recurse
    Remove-Item -Path "$env:SYSTEMDRIVE\ProgramData\Microsoft\Windows\Start Menu\Programs\Abvakabo FNV\Interactive Intelligence" -Recurse -Force
    else {
    Write-Output "$logdate - Client not present" | out-file $logfile -Append
    # Installeer CIC Client SU6
    $Arguments = "/i `"$SourceDir\ICUserApps_32bit.msi`" /l*vx `"$env:TEMP\cic_su6.log`" TRANSFORMS=`"$SourceDir\Kantoor.mst`" PATCH=`"$SourceDir\ICUserApps_32bit_SU6.msp`" ICSERVERNAME=cic.abvakabofnv.local /QN /norestart"
    $process = Start-Process -Filepath "msiexec.exe" -Argumentlist "$Arguments" -Wait -Passthru
    if ($process.ExitCode -eq 0) {
    Write-Output "$logdate - CIC Client SU6 (kantoor) has been succesfully installed" | out-file $logfile -Append
    else {
    Write-Output "$logdate - CIC Client SU6 (kantoor) cannot be succesfully installed - " $process.ExitCode | out-file $logfile -Append
    exit
    # Installeer CIC Client SU6 NL Language Plugin
    $Arguments = "/i `"$SourceDir\LanguagePlugins\ICUserApps_LanguagePlugin_nl.msi`" /l*vx `"$env:TEMP\cic_su6_nl.log`" PATCH=`"$SourceDir\LanguagePlugins\ICUserApps_LanguagePlugin_nl_SU6.msp`" /QN /norestart"
    $process = Start-Process -Filepath "msiexec.exe" -Argumentlist "$Arguments" -Wait -Passthru
    if ($process.ExitCode -eq 0) {
    Write-Output "$logdate - CIC Client SU6 Languagepack NL has been succesfully installed" | out-file $logfile -Append
    else {
    Write-Output "$logdate - CIC Client SU6 Languagepack NL cannot be succesfully installed - " $process.ExitCode | out-file $logfile -Append
    exit
    # Opschonen Desktop en Start menu
    Remove-Item -Path "$env:PUBLIC\Desktop\Interaction Fax.lnk"
    Remove-Item -Path "$env:PUBLIC\Desktop\Interaction Voicemail Player.lnk"
    Move-Item -Path "$env:SYSTEMDRIVE\ProgramData\Microsoft\Windows\Start Menu\Programs\Interactive Intelligence" "$env:SYSTEMDRIVE\ProgramData\Microsoft\Windows\Start Menu\Programs\Abvakabo FNV" -force
    The uninstall part works fine, but the installation (2 parts) do not. As I mentioned before... when I run the script manually it all works fine.
    The application is installed using a script. The commandline is
    powershell.exe -excecutionpolicy bypass -file Install_UserApps_SU6_Kantoor.ps1
    The application runs hidden in the context of the system wether or not the user is logged on. The maximum allowed run time is sufficient (30 minutes).
    There is no installation log from the msiexec command so the line were the application should be installed is not executed at all. There is also no mention in my own little log ($logfile = "$env:TEMP\cic_su6-install.txt") mentioning the result
    of the installation.
    The appenforce.log says...
    +++ Starting Install enforcement for App DT "Interaction Client - Standaard SU6" ApplicationDeliveryType - ScopeId_2EC1E80A-D73E-4152-A94F-546E7827CCB6/DeploymentType_720b132a-5626-4055-9555-18b4775724c4, Revision - 7, ContentPath - C:\WINDOWS\ccmcache\13, Execution Context - System AppEnforce 17-4-2015 16:31:05 640 (0x0280)
    A user is logged on to the system. AppEnforce 17-4-2015 16:31:05 640 (0x0280)
    Performing detection of app deployment type Interaction Client - Standaard SU6(ScopeId_2EC1E80A-D73E-4152-A94F-546E7827CCB6/DeploymentType_720b132a-5626-4055-9555-18b4775724c4, revision 7) for system. AppEnforce 17-4-2015 16:31:05 640 (0x0280)
    +++ Application not discovered. [AppDT Id: ScopeId_2EC1E80A-D73E-4152-A94F-546E7827CCB6/DeploymentType_720b132a-5626-4055-9555-18b4775724c4, Revision: 7] AppEnforce 17-4-2015 16:31:05 640 (0x0280)
    App enforcement environment:
    Context: Machine
    Command line: Powershell.exe -executionpolicy bypass -file Install_UserApps_SU6_Kantoor.ps1
    Allow user interaction: No
    UI mode: 0
    User token: null
    Session Id: 1
    Content path: C:\WINDOWS\ccmcache\13
    Working directory: AppEnforce 17-4-2015 16:31:05 640 (0x0280)
    Prepared working directory: C:\WINDOWS\ccmcache\13 AppEnforce 17-4-2015 16:31:05 640 (0x0280)
    Found executable file Powershell.exe with complete path C:\WINDOWS\System32\WindowsPowerShell\v1.0\Powershell.exe AppEnforce 17-4-2015 16:31:05 640 (0x0280)
    Prepared command line: "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe" -executionpolicy bypass -file Install_UserApps_SU6_Kantoor.ps1 AppEnforce 17-4-2015 16:31:05 640 (0x0280)
    Executing Command line: "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe" -executionpolicy bypass -file Install_UserApps_SU6_Kantoor.ps1 with user context AppEnforce 17-4-2015 16:31:05 640 (0x0280)
    Working directory C:\WINDOWS\ccmcache\13 AppEnforce 17-4-2015 16:31:05 640 (0x0280)
    Post install behavior is BasedOnExitCode AppEnforce 17-4-2015 16:31:05 640 (0x0280)
    Waiting for process 2916 to finish. Timeout = 30 minutes. AppEnforce 17-4-2015 16:31:05 640 (0x0280)
    Process 2916 terminated with exitcode: 0 AppEnforce 17-4-2015 16:31:08 640 (0x0280)
    Looking for exit code 0 in exit codes table... AppEnforce 17-4-2015 16:31:08 640 (0x0280)
    Matched exit code 0 to a Success entry in exit codes table. AppEnforce 17-4-2015 16:31:08 640 (0x0280)
    Performing detection of app deployment type Interaction Client - Standaard SU6(ScopeId_2EC1E80A-D73E-4152-A94F-546E7827CCB6/DeploymentType_720b132a-5626-4055-9555-18b4775724c4, revision 7) for system. AppEnforce 17-4-2015 16:31:08 640 (0x0280)
    +++ Application not discovered. [AppDT Id: ScopeId_2EC1E80A-D73E-4152-A94F-546E7827CCB6/DeploymentType_720b132a-5626-4055-9555-18b4775724c4, Revision: 7] AppEnforce 17-4-2015 16:31:08 640 (0x0280)
    ++++++ App enforcement completed (3 seconds) for App DT "Interaction Client - Standaard SU6" [ScopeId_2EC1E80A-D73E-4152-A94F-546E7827CCB6/DeploymentType_720b132a-5626-4055-9555-18b4775724c4], Revision: 7, User SID: ] ++++++ AppEnforce 17-4-2015 16:31:08 640 (0x0280)
    I'm thinking of going back to a batchfile because that seems to do the job, but Powershell is much more powerfull.
    Anybody got any answers on what is going wrong are some suggestions for a better script? 

    You have a number of problems here.
    1.  As mentioned you have UNC paths ... which means there's no reason for a package at all.  f you want SCCM to use the package it just downloaded you should use $PSScriptRoot (PS equivelant of %~0dp).  If the client is using v2 or earlier
    ... fix that quick by starting your script with:
    If (!$PSScriptRoot) {
    $PSSCriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
    Now you can call your install easy enough with a $PSScriptRoot+"\app.exe"
    2.  your discovery is failing after install.  This will always make SCCM report an installation failed even when the exit code is 0.  You can see it at the end of your log:
    Matched exit code 0 to a Success entry in exit codes table. AppEnforce 17-4-2015 16:31:08 640 (0x0280)
    Performing detection of app deployment type Interaction Client - Standaard SU6(ScopeId_2EC1E80A-D73E-4152-A94F-546E7827CCB6/DeploymentType_720b132a-5626-4055-9555-18b4775724c4, revision 7) for system. AppEnforce 17-4-2015 16:31:08 640 (0x0280)
    +++ Application not discovered. [AppDT Id: ScopeId_2EC1E80A-D73E-4152-A94F-546E7827CCB6/DeploymentType_720b132a-5626-4055-9555-18b4775724c4, Revision: 7] AppEnforce 17-4-2015 16:31:08 640 (0x0280)
    So either your installation script is spitting out a exit code 0 regardless of the event OR your detection is wrong.
    EDIT:  you have exit statemetns after failed installs ... but no exit code (simply exit).  Change those to exit 1 so sccm knows it's a failed exit and not just a generic exit.  That's probably your problem (unc can't be reached as system, you're
    getting an exit  .... not defining exit 1).
    Something like this (warning this is a fast change so review it):
    <#
    Installatiescript CIC Client SU6 32 bit (kantoor)
    Versie 1.3
    17 april 2015 - Uitbreiding logfile. Fix opschonen startmenu
    16 april 2015 - Aanpassing verwijderen oude client, logfile aanmaken in TEMP
    13 maart 2015 - Eerste versie
    #>
    If (!$PSScriptRoot) {
    $PSSCriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
    # Bepaal installatiebron
    #$SourceDir = "\\VSC0501\SetupShare\APP_IC_Client_SU6\x86"
    $SourceDir = $PSScriptRoot
    # Bepaal logvariabelen
    $logfile = "$env:TEMP\cic_su6-install.txt"
    $Logdate = get-date -f yyyyMMdd-HHmm
    # Controleer of oude CIC client aanwezig is (versie 4.04.316) en deinstalleer deze indien nodig
    If (Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{543BE3AC-426D-4FDD-8160-ECEEC2E211B6}")
    $val = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{543BE3AC-426D-4FDD-8160-ECEEC2E211B6}").DisplayVersion
    if($val -eq "4.04.316") {
    $process = Start-Process -Filepath "msiexec.exe" -Argumentlist "/x {3F20671C-9CA2-41FA-B94A-C7C7FD95C7B4} /QN" -Wait -Passthru
    if ($process.ExitCode -eq 0) {
    Write-Output "$logdate - Client has been succesfully removed" | out-file $logfile -Append
    else {
    Write-Output "$logdate - Client cannot be succesfully removed" | out-file $logfile -Append
    exit 1
    $process = Start-Process -Filepath "msiexec.exe" -Argumentlist "/x {543BE3AC-426D-4FDD-8160-ECEEC2E211B6} /QN" -Wait -Passthru
    if ($process.ExitCode -eq 0) {
    Write-Output "$logdate - Client has been succesfully removed" | out-file $logfile -Append
    else {
    Write-Output "$logdate - Client cannot be succesfully removed - " $process.ExitCode | out-file $logfile -Append
    exit 1
    #(Start-Process -Filepath "msiexec.exe" -Argumentlist "/x {3F20671C-9CA2-41FA-B94A-C7C7FD95C7B4} /QN" -Wait -Passthru).exitcode
    #(Start-Process -Filepath "msiexec.exe" -Argumentlist "/x {543BE3AC-426D-4FDD-8160-ECEEC2E211B6} /QN" -Wait -Passthru).exitcode
    Get-ChildItem "$env:SYSTEMDRIVE\ProgramData\Microsoft\Windows\Start Menu\Programs\Abvakabo FNV\Interactive Intelligence" | Remove-Item -Recurse
    Remove-Item -Path "$env:SYSTEMDRIVE\ProgramData\Microsoft\Windows\Start Menu\Programs\Abvakabo FNV\Interactive Intelligence" -Recurse -Force
    else {
    Write-Output "$logdate - Client not present" | out-file $logfile -Append
    # Installeer CIC Client SU6
    $Arguments = "/i `"$SourceDir\ICUserApps_32bit.msi`" /l*vx `"$env:TEMP\cic_su6.log`" TRANSFORMS=`"$SourceDir\Kantoor.mst`" PATCH=`"$SourceDir\ICUserApps_32bit_SU6.msp`" ICSERVERNAME=cic.abvakabofnv.local /QN /norestart"
    $process = Start-Process -Filepath "msiexec.exe" -Argumentlist "$Arguments" -Wait -Passthru
    if ($process.ExitCode -eq 0) {
    Write-Output "$logdate - CIC Client SU6 (kantoor) has been succesfully installed" | out-file $logfile -Append
    else {
    Write-Output "$logdate - CIC Client SU6 (kantoor) cannot be succesfully installed - " $process.ExitCode | out-file $logfile -Append
    exit 1
    # Installeer CIC Client SU6 NL Language Plugin
    $Arguments = "/i `"$SourceDir\LanguagePlugins\ICUserApps_LanguagePlugin_nl.msi`" /l*vx `"$env:TEMP\cic_su6_nl.log`" PATCH=`"$SourceDir\LanguagePlugins\ICUserApps_LanguagePlugin_nl_SU6.msp`" /QN /norestart"
    $process = Start-Process -Filepath "msiexec.exe" -Argumentlist "$Arguments" -Wait -Passthru
    if ($process.ExitCode -eq 0) {
    Write-Output "$logdate - CIC Client SU6 Languagepack NL has been succesfully installed" | out-file $logfile -Append
    else {
    Write-Output "$logdate - CIC Client SU6 Languagepack NL cannot be succesfully installed - " $process.ExitCode | out-file $logfile -Append
    exit 1
    # Opschonen Desktop en Start menu
    Remove-Item -Path "$env:PUBLIC\Desktop\Interaction Fax.lnk"
    Remove-Item -Path "$env:PUBLIC\Desktop\Interaction Voicemail Player.lnk"
    Move-Item -Path "$env:SYSTEMDRIVE\ProgramData\Microsoft\Windows\Start Menu\Programs\Interactive Intelligence" "$env:SYSTEMDRIVE\ProgramData\Microsoft\Windows\Start Menu\Programs\Abvakabo FNV" -force
    Exit 0

  • Is there Java API available for third-party integrations with SCCM 2012? I went through the "Developer's Survival Guide", and it seems that SCCM 2012 SDKs only support C# and PowerShell

    Hi All,<o:p></o:p>
    My team and I are developing a software using java that works closely with IT management software such as SCCM. Our software will be highly dependent on data stored in SCCM. Basically
    our software will talk to SCCM to get information about a system managed by SCCM. To be able to do that, our software needs to use a java API that talks to SCCM. Is there a java API for SCCM 2012 that we can use? If there is not, what is the work around to
    this issue (integrate a java project with SCCM SDKs)? Any help is appreciated! Thanks!<o:p></o:p>

    Hi,
    As you mentioned, it seems that there is no available Java API for SCCM .
    Just curious, what's information you want to get from SCCM.
    Based on my experience, you could query the SCCM site database to get almost all the information.
    Otherwise, your question seems to be related to SCCM 2012. You may also choose to post there to get more effictive help.
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Create report subscription with powershell in SCCM 2012 R2

    Hi all,
    I'm wondering if it's possible to create report subscriptions with powershell ? This would save me a lot of time.
    Kind regards,
    J.M.

    If there was any it would be part of the SSRS PoSH cmdlets.  
    http://www.enhansoft.com/

  • Powershell and SCCM 2012 Collections from AD

    Greetings everyone, I am trying to take a select of groups in a certain OU within AD to make SCCM 2012 user collections from. I been playing around with just creating the collections based upon a txt file which would work and is probably easier. Can someone
    go through this mess I have down here and make this work. I found some scripts that do what I need but they just aren't flowing together well. Thanks for any help you can give. I think the 'DOMAIN\\'$ADName isn't going to work either. Thoughts?
    import-module ($Env:SMS_ADMIN_UI_PATH.Substring(0,$Env:SMS_ADMIN_UI_PATH.Length-5) + '\ConfigurationManager.psd1')
    $PSD = Get-PSDrive -PSProvider CMSite
    CD "$($PSD):"
    $ADName = Get-Content -Path C:\fso\ADgroups.txt
    New-CMUserCollection -Name $ADName -LimitingCollectionName "All Users and User Groups" -RefreshType Both
    Add-CMUserCollectionQueryMembershipRule -CollectionName $ADName -QueryExpression "select *  from  SMS_R_User where SMS_R_User.UserGroupName = 'DOMAIN\\'$ADName" -RuleName "QueryRuleName1"

    Hi,
    I highly recommend asking this question in the ConfigMgr 2012 SDK/PowerShell forum:
    http://social.technet.microsoft.com/Forums/en-US/home?forum=configmanagersdk&filter=alltypes&sort=lastpostdesc
    This forum is meant for general PowerShell questions. Hopefully you'll get a good response from someone here, but the people who are familiar with the ConfigMgr cmdlets will be more likely to see your question in the specialized forum.
    Don't retire TechNet! -
    (Don't give up yet - 12,950+ strong and growing)

  • Windows 8.1 clients are not detecting updates deployed to them through SCCM 2012 R2

    Hello, 
    We are using SCCM 2012 R2 to deploy software updates. 
    On Windows 8.1 SCCM does not show certain updates as being needed and isn't deploying them to the clients even though Windows Update will show them as high importance. These same updates are being detected and deployed to Windows 8 clients successfully.
    I believe that the update catalog that WSUS uses may have some incorrect detection rules for the following updates:  
    2917933
    2913320
    2913270
    2913152
    2909569
    2904440
    2904266
    2903939
    2899189 
    2893984
    2893294
    2892074
    2916626
    2898785
    My automatic deployment rules include Windows 8.1 in the product category. I have even created a standalone rule for Windows 8.1 that builds a new package and the behavior is the same. 
    We only have a handful of Windows 8+ clients so this hasn't been a big issue but others may want to keep an eye out. 

    I am also running into this issue.  After "checking online for updates" on one of my machines in office I found that there were 21 important updates for my 8.1 box.  When I cross reference them in SCCM under All Software Updates, it appears these
    8.1 updates are not listed.  They are however listed for all other OS.  
    10 seconds after typing this, I went in to verify my WSUS ->  Products and Classifications settings and come to find 8.1 and 2012 R2 weren't selected, even though it's an option in SCCM.  Go figure!  This wasn't the end though.  After
    running a Synchronization, my issue still wasn't resolved.  Went back to check my settings and they again were changed back to having these OS unchecked.  Finally, a solution!  I found that in SCCM, under Administration tab, Site Configuration
    > Sites > ABC - Mysitename, right click and scroll down to "Configure Site Components" > Software Update Point.  This setting (although the same as is in WSUS) takes precedence, thus was rolling my settings back to the original configuration
    in WSUS.
    So long story short, even though my automatic deployment rules stated approve all windows 7/8/8.1 criticals/importants, 8.1 was getting skipped for the most part because my WSUS server wasn't syncing with Microsoft for all of the updates I required.  I
    did have a couple of updates that squeezed through because they were categorized as "Security Updates for Windows 8, 8.1".
    Not sure if this is the solution you were looking for, but your thread got me started in the right direction, hopefully this response helps in the same way!
    Thanks!

Maybe you are looking for