SCCM 2012 powershell only when no user is logged in

Hi All,
I think this is probably me, I am trying to run a powershell script which calls an MSI in the Application node, seems to work fine when the user is logged on, but I wanted to run this as, only when no user is logged on, and install for system. It seems to
start and just exit straight away.
Command line: that I use: powershell.exe -noprofile -executionpolicy bypass -file .\Install.ps1 is this correct to run as system?

I'm also having a very similar issue. In my scenario, I have a PowerShell script that runs an software update tool with different parameters based on the value of a specific registry entry. I was testing the SCCM Application when logged on and just running
for Software Center and it runs as expected, but when I changed the User Experience from "Run whether or not a user is logged on" to "Only when no users are logged on" and it fails.  In the AppEnforce.log the following lines are present:
<![LOG[+++ Starting Install enforcement for App DT "Set New Servers - addiman" ApplicationDeliveryType - ScopeId_2E6C34BD-8633-43D8-B5B5-09A1C291D45B/DeploymentType_56ca55b4-ce9b-4dfd-a64f-db3da408013b, Revision - 5, ContentPath
- C:\WINDOWS\ccmcache\3n, Execution Context - System]LOG]!><time="11:06:10.878+480" date="02-12-2015" component="AppEnforce" context="" type="1" thread="1628" file="appprovider.cpp:1702">
<![LOG[The enforcement of this App DT requires all users to be logged off.  The deployment cannot specify a user collection when the deployment type requires that a user must be logged off.  Aborting enforcement.]LOG]!><time="11:06:10.879+480"
date="02-12-2015" component="AppEnforce" context="" type="3" thread="1628" file="appprovider.cpp:1732">
<![LOG[CommenceEnforcement failed with error 0x87d0031d.]LOG]!><time="11:06:10.880+480" date="02-12-2015" component="AppEnforce" context="" type="3" thread="1628" file="appprovider.cpp:1825">
<![LOG[Method CommenceEnforcement failed with error code 87D0031D]LOG]!><time="11:06:10.880+480" date="02-12-2015" component="AppEnforce" context="" type="3" thread="1628" file="appprovider.cpp:2390">
<![LOG[++++++ Failed to enforce app. Error 0x87d0031d. ++++++]LOG]!><time="11:06:10.885+480" date="02-12-2015" component="AppEnforce" context="" type="3"
thread="1628" file="appprovider.cpp:2467">
I've did confirm that the Deployment was not to a User Collection as is implied by the error message and I even went as far as deleting and recreating the Deployment.
In addition, I have another Application (Java 7 Update 31) that I have set to "Only when no users to login" and it installs as expected. When run from Software Center the Status changes to "Waiting for users to log off" and it is installed
after I log off.
Is there some issue with this when trying to run a PowerShell script when logged off?
Thank you in advance for any insight as to this in consistent behavior.
Bill Hunt

Similar Messages

  • I wan't setup for sccm 2012 read only console

    i wan't setup for sccm 2012 read only console

    There is role read only analyst please assign same to user or group.

  • A program to trace when a user is logged in/out the system

    Hi,
    How would I write an ABAP to determine when the user is logged into a SAP system, what transaction code has been launched by the user, and when the user exits or changes a transaction code?
    Or is there a FM that provides this information?
    Thanks,
    RT
    Message was edited by: Rob  Thomas

    Hi,
    You can find some information in STAT and STAD transactions. But these information will be only available for programs with atleast some screens
    either a report list screen or a selection screen or a module dialog.
    There are also quite a no of BAPIS related to User logons.
    Cheers
    VJ

  • 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.

  • SCCM 2012 Reporting Only

    Hello,
    I'm looking for a way to only allow some users to use the reporting function of SCCM 2012. So far it seems as I grant permissions they get access to other parts of SCCM as well. Is there a way to configure their account to only view and run reports as need?
    If so, could you please explain the process? Thanks!
    Pat
    Pat

    I'm having some issues. I wanted to take screen shots but it won't allow me to paste on the forum. I'm a full administrator of SCCM. When I view my different reporting options I have 58 category of reports which there are more reports inside each category.
    I followed the directions from the links provided but when my user goes to view the reports they do not see as much as I do. I don't know the exact amount of reports he can view but I think it's about 11. I'm not sure how to allow the rest of the reports to
    be visible. I went down each security setting and if it had the option to "Run Report" and made sure it said "Yes". Any help is appreciated.
    Pat

  • SQL Connection Failed for SCCM 2012 R2 (Unable to load user-specified certificate)

    We've recently completed an upgrade from SCCM 2012 SP1 to 2012 R2 and have been running in the new environment for about a week. As of this morning, The consoles failed to connect to the CAS' and one of the Primary Site's database. The issue was resolved
    easily enough by addressing a certificate issue in SQL, but I'm left wondering if there's a correlation between the SP1-to-R2 upgrade that would cause the cert to fail. Anyone have experience with this?
    2014-01-21 22:10:11.81 Server      The server could not load the certificate it needs to initiate an SSL connection. It returned the following error: 0x8009030d. Check certificates to make sure they are valid.
    2014-01-21 22:10:11.81 Server      Error: 26014, Severity: 16, State: 1.
    2014-01-21 22:10:11.81 Server      Unable to load user-specified certificate [Cert Hash(sha1) "haaaaassssshhhh"]. The server will not accept a connection. You should verify that the certificate is correctly installed. See
    "Configuring Certificate for Use by SSL" in Books Online.
    2014-01-21 22:10:11.81 Server      Error: 17182, Severity: 16, State: 1.
    2014-01-21 22:10:11.81 Server      TDSSNIClient initialization failed with error 0x80092004, status code 0x80. Reason: Unable to initialize SSL support. Cannot find object or property.
    2014-01-21 22:10:11.81 Server      Error: 17182, Severity: 16, State: 1.
    2014-01-21 22:10:11.81 Server      TDSSNIClient initialization failed with error 0x80092004, status code 0x1. Reason: Initialization failed with an infrastructure error. Check for previous errors. Cannot find object or property.
    2014-01-21 22:10:11.81 Server      Error: 17826, Severity: 18, State: 3.
    2014-01-21 22:10:11.81 Server      Could not start the network library because of an internal error in the network library. To determine the cause, review the errors immediately preceding this one in the error log.
    2014-01-21 22:10:11.81 Server      Error: 17120, Severity: 16, State: 1.
    2014-01-21 22:10:11.81 Server      SQL Server could not spawn FRunCM thread. Check the SQL Server error log and the Windows event logs for information about possible related problems.

    We got the same certificate related error events after a fresh install of SCCM 2012 R2 on a new server. It happened during the first reboot after SCCM was installed. In the Certificates mmc, I right-clicked on the certificate used by SQL and chose Manage
    Private Keys. Giving the service account that runs the MSSQLSERVER service read rights to the private key allowed SQL to start. However, after a day or so we rebooted the server again, and SQL wouldn't start. Something had removed the service account's read
    permission. Since the SCCM configuration wasn't that far along, we uninstalled SCCM. After giving the service account read rights again, and rebooting several times over a few days, and SQL started every time. We then installed SCCM 2012 R2 again, and checked
    the certificate's permissions before rebooting. The service account still had read permissions when the install completed, but as soon as the server was rebooted, it lost the permissions again.
    The Certificates mmc was then used to request a second computer certificate and then SQL was configured to use that new certificate via SQL Server Configuration Manager. After several days and a number of reboots the SQL services have started normally every
    time so the second certificate seems to have fixed the issue. I have kept the original certificate for fear that removing it will cause whatever part of SCCM 2012 R2 that modifies the original certificate to start removing permissions from the new certificate
    as well.

  • SCCM 2012 SP1 errors when downloading updates

    Currently using SCCM 2012 SP1 with CU2 and I am having some update download issue with Automatic Deployment Rules.
    The Environment is:
      Server 2008 R2
      SCCM 2012 SP1 CU2 (Upgraded from SCCM 2012 CU2)
    I created an Automatic Deployment Rule for Adobe Flash. Since I was having the same issue with Adobe Reader, when I published via SCUP to WSUS I chose not to sign the updates.
    After publishing to WSUS I then sync SCCM, I see the updates and then in the ADR I had it download the updates and I see this error:
    Authentication of file C:\Windows\TEMP\CABDEC5.tmp failed, error 0x800b0004 Software Updates Patch Downloader 8/15/2013 6:49:43 PM 3712 (0x0E80)
    ERROR: DownloadContentFiles() failed with hr=0x80073633 Software Updates Patch Downloader 8/15/2013 6:49:43 PM 6876 (0x1ADC)
    Failed to download the update from internet. Error = 13875 SMS_RULE_ENGINE 8/15/2013 6:49:43 PM 6876 (0x1ADC)
    Failed to download ContentID 16845337 for UpdateID 16841530. Error code = 13875 SMS_RULE_ENGINE 8/15/2013 6:49:43 PM 6876 (0x1ADC)
    Now the funny thing is if I go to the update itself within update group that Flash is a member I can right click it and choose download and the error doesn't occur.
    I observed that the UNC path for ADR Adobe flash, when the rule is ran, is populated with folders that have a name something like 44738297895427890.1 or 423154325378u867234789.1. I have come to realize that those are failed downloads. So for the
    heck of it I then right clicked the update itself and chose download and it downloaded without issue. Now I'm guessing that when I chose to download directly from the update maybe the system is getting the update from adobe and not from wherever the rule was
    trying to get it from.  I then see the .1 removed from the directory name and there are updates within them.
    Just for clarity here are the steps I go through from SCUP to Syncing...
    Log in to WSUS server
    Run SCUP as administrator
    Get notified there are updates from Adobe and let SCUP download updates
    Find the updates the specify the following publishing options
    Full Content
    Sign all software updates with a new publishing certificate .... (Is this necessary by the way?)
    Then click Next
    After that's done I then go to SCCM Manager Console and go to Software Updates and right click to Synchronize them.
    After that's done then I run the ADR for Adobe Flash and when it goes to download the updates that's when the error occurs.
    What am I missing?
    Also, while I wait for help I just recently added the WSUS SCUP certificate to the SCCM server to see if by chance that fixes stuff. If it does then I'll post the results of adding the certificate to the SCCM server.
    One other thing, is there a way to delete updates? When I was having this issue in the past, I went in to SCUP I marked the updates as expired and then deleted the updates. Went to SCCM and synchronized the updates and they went from not expired to expired
    then I waited, maybe 30 days or so before I could add the updates back in.
    Thanks for the help!

    Yes, I know this is an old post, but I’m trying to clean them up. Did you solve this problem, if so what was the solution?
    Have you seen the note at the bottom of this page about this error?
    http://technet.microsoft.com/en-us/library/bb932193.aspx
    Garth Jones | My blogs: Enhansoft and
    Old Blog site | Twitter:
    @GarthMJ

  • SCCM 2012 Report that shows the users with specific software installed

    Hi,
    Is there a report in SCCM 2012 that shows the users with specific software installed? The report should show username, machine name and the software name. I am looking for a report that shows the users with the following softwares installed:
    1. Adobe(all versions)
    2. Photoshop(all versions)
    3. MS Project(all versions)
    4. MS Vision(all versions)
    Regards, Lorin Davis

    Take a look at the Asset Intelligence reports in the software section. You may get a list of computers with a product installed, and you might have to use that list to find the primary users based on user device affinity.

  • SCCM 2012 usage report for remote users

    Hi,
    Can someone help to get the SCCM  usage report for all remote users who accessed particular application remotely on windows 7 workstation
    Regards,
    Madhan

    If the application is something and executable that the users have to start, you can use Software Metering.
    My Blog: http://www.petervanderwoude.nl/
    Follow me on twitter: pvanderwoude

  • Display Community Names, only when Current User is a Member of that Community

    Greetings,
    I have a Community Site Collection(say ABC). Within that I have many Community Sub-sites(say X,Y,Z). I want to display the Community Sub-site Names in Community Home-page for the Condition,
                      When Current User name Exists in "Community Members".
    1.For that i have to access "Community Members" list from all Sub-sites(say X,Y,Z) within Community Site Collection(say ABC).
    2.Display Community Sub-sites Name Queried for Current-user Name Exists in "Member" Column of "Community Members" List
    Is this the Correct Solution for my Requirement? Or any Best Practice available? 
    Thanks in Advance for help

    Thanks for your Reply
    You mean I need to use Custom Webpart and Content Editor in my Community Homepage.
    1.Custom Webpart for displaying all Subsites within SiteCollection and
    2.Content Editor to hide Community name(By Using JavaScript)
    I can display all Subsites within SiteCollection using Spweb.getsubwebsforcurrentUser()
    But it seems complex to hide non-member community names. The reason is that for a particular user itself i need to filter out "Is this Current User Member of this Community?" for all Subsites
    Any better Solution? Hope it would be
    Thanks,
    Vinnarasi

  • Can SCCM 2012 alert me when new devices are found on the network?

    I have a single SCCM 2012 SP1 CU4 server running on Windows Server 2012.  I use it primarily for Endpoint Protection and Windows Updates.
    I have 18 locations in my organization.  I am having a problem with a particular remote site buying their own IT equipment (computers, switches, access points, etc.).  I was wondering if it is possible for my SCCM server to e-mail (alert) me whenever
    it detects a new device on the network?  Or should I be looking at
    SCOM for something like this?  If SCCM will not do this, can anyone suggest some freeware that might do what I am looking for?
    Thanks!

    The answer to that would be ... it depends.
    If the computers are domain joined and your AD discovery method is enabled they will end up in the ConfigMgr database. From that point onward you could create a custom reports that lists these systems. You can subscribe to the report to get it through email.
    For network devices you could also do something similar but initially you would have to enable network discovery in ConfigMgr.
    Highly impractical IMO. I seriously doubt this could ever work in a production environment of any real size.
    In addition.... Network discovery in CM is nasty!
    John Marcum | http://myitforum.com/myitforumwp/author/johnmarcum/

  • Only One Mobile User can Log In to Laptop

    I have a network account on my Mac Book Pro. I can log in no problem, access everything on the network, etc. but no one else can log in to this particular laptop. All of the other users can log into each other's identical Mac Book Pros, my account included. I have checked in my MBP's System Preferences > Accounts and the "Allow network users to login to this computer" checkbox is checked. The PDC is Leopard 10.5.6 running Open Directory.
    When one of the other network accounts tries to log in to my computer we get the following error:
    You are unable to login to the user account (username) at this time. Logging in to the account failed because of an error.
    I have googled that error but nothing seems to apply to this situation. Most of the postings found here and on the web are authenticating against Active Directory, and the assumption seems to be no one can log in, not just select accounts.
    I've done plenty of searching here and on Google but the description of the problem is hard to summarize so I'm posting my own question. Thank you in advance for any information you can provide.

    Is this a second hand phone? It sounds like the it is and the previous owner did not disable Activation Lock, the antitheft feature of iOS. If this is the case then the only solution is to get the previous owner to unlock it.

  • OSD SCCM 2012 R2: MDT integrated task sequence central logging not working

    Hi,
    Please advise on making dynamic logging work for SCCM 2012 R2 MDT integrated tasks sequence.
    This is what I specified in customsettings.ini
    [Settings]
    Priority=Default
    Properties=MyCustomProperty
    [Default]
    OSInstall=Y
    SkipCapture=YES
    SkipAdminPassword=NO
    SkipProductKey=YES
    ; Copy Logs if en error occurs or when deployment is successfully completed
    SLSHARE=\\sccmserver\OSD\Logs\MDT
    ; Enable Dynamig Logging
    SLSHAREDynamicLogging=\\\sccmserver\OSD\Logs\MDTDynLogs\%OSDComputername%
    UserID=administrator
    UserDomain=ourdomain
    UserPassword=ourpassword
    Jan Hoedt

    I keep on getting access denied though when I connect in a dosprompt with the credentials I can make a connection.
    Mapping server share: \\ourdomain.com\share    ZTIValidate    4/03/2014 0:08:14    0 (0x0000)
    <Message containing password has been suppressed>    ZTIValidate    4/03/2014 0:08:14    0 (0x0000)
    Access is denied.
        ZTIValidate    4/03/2014 0:08:14    0 (0x0000)
    Unable to connect to \\ourdomain.com\share.  Sleeping for 5 seconds.    ZTIValidate    4/03/2014 0:08:14    0 (0x0000)
    <Message containing password has been suppressed>    ZTIValidate    4/03/2014 0:08:19    0 (0x0000)
    Access is denied.
        ZTIValidate    4/03/2014 0:08:19    0 (0x0000)
    Unable to connect to \\ourdomain.com\share.  Sleeping for 10 seconds.    ZTIValidate    4/03/2014 0:08:19    0 (0x0000)
    <Message containing password has been suppressed>    ZTIValidate    4/03/2014 0:08:29    0 (0x0000)
    Access is denied.
        ZTIValidate    4/03/2014 0:08:29    0 (0x0000)
    Unable to connect to \\ourdomain.com\share.  Sleeping for 15 seconds.    ZTIValidate    4/03/2014 0:08:29    0 (0x0000)
    <Message containing password has been suppressed>    ZTIValidate    4/03/2014 0:08:44    0 (0x0000)
    Access is denied.
        ZTIValidate    4/03/2014 0:08:44    0 (0x0000)
    Unable to connect to \\ourdomain.com\share.  Sleeping for 20 seconds.    ZTIValidate    4/03/2014 0:08:44    0 (0x0000)
    <Message containing password has been suppressed>    ZTIValidate    4/03/2014 0:09:04    0 (0x0000)
    Access is denied.
        ZTIValidate    4/03/2014 0:09:05    0 (0x0000)
    Unable to connect to \\ourdomain.com\share.  Sleeping for 25 seconds.    ZTIValidate    4/03/2014 0:09:05    0 (0x0000)
    ERROR - Unable to map a network drive to \\ourdomain.com\share.    ZTIValidate    4/03/2014 0:09:30    0 (0x0000)
    An invalid SLShareDynamicLogging value of \\ourdomain.com\share\PackageSources\OSD\Logs\MDT-DynLogs\computername was specified.    ZTIValidate    4/03/2014 0:09:30    0 (0x0000)
    Jan Hoedt

  • SCCM 2012 Setup error when setting SQL connection info "Network Path Was Not Found"

    Hello.
    I'm facing an issue during CCM 2012 SP1 Beta Setup on step "DB INFORMATION"
    My lab is set like that:
    1x Front-end WS 2012 rtm "CCM Install on it" (Fresh install = no features installed)
    1x Back-end WS 2012 rtm SQL Server 2012 SP1 (I don't know if this is supported).
    On the sql Side there is already a first instance with SCVMM 2012 SP1(beta) environment that work well.
    A second dedicated instance is ready for CCM install.
    Named Pipes enabled , TCP/IP Enabled
    Firewall rules for 1433 and 4022 are enabled on the Domain profile ,other profiles are disabled.
    Instance Service is running with a domain account
    Everything is published in AD (delegations for computer account), Schema Prep already done manually.
    I'm Able to resolve dns name of the SQL server on the CCM VM and telnet 4022 + 1433 ports.
    For the finish here is the end of Setup Wizard logs:
    Exception rethrown at [0]:
       à System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)
       à System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData)
       à Microsoft.SystemCenter.ConfigMgr.Setup.CheckSqlAsync.EndInvoke(IAsyncResult result)
       à Microsoft.SystemCenter.ConfigMgr.Setup.DatabasePage.ValidatePage()
       à Microsoft.SystemCenter.ConfigMgr.SetupFramework.WizardForm.ActivatePage(String pageId, Boolean goingNext)
       à System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       à System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       à System.Windows.Controls.Button.OnClick()
       à System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
       à System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       à System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       à System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
       à System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
       à System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       à System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       à System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       à System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       à System.Windows.Input.InputManager.ProcessStagingArea()
       à System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       à System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
       à System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
       à System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       à System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       à MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       à MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       à System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
       à System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)].
    14/12/2012 08:21:06: ConfigMgrSetupWizard Information: 1 : Creating SQL connection to database SCCM\master on server SQL001.IT-DEPLOYMENT.LAB.
    14/12/2012 08:21:53: ConfigMgrSetupWizard Error: 1 : Exception message: [Le chemin réseau n’a pas été trouvé.
    ], Exception details: [System.IO.IOException: Le chemin réseau n’a pas été trouvé.
    Server stack trace:
       à Microsoft.Win32.RegistryKey.Win32ErrorStatic(Int32 errorCode, String str)
       à Microsoft.Win32.RegistryKey.OpenRemoteBaseKey(RegistryHive hKey, String machineName)
       à Microsoft.SystemCenter.ConfigMgr.Setup.DatabaseUtility.GetSqlConnection(String databaseName, String serverName, Boolean encrypt)
       à Microsoft.SystemCenter.ConfigMgr.Setup.DatabaseUtility.CheckSqlConnection(String serverName, String instanceName)
       à System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
       à System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
    Exception rethrown at [0]:
       à System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)
       à System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData)
       à Microsoft.SystemCenter.ConfigMgr.Setup.CheckSqlAsync.EndInvoke(IAsyncResult result)
       à Microsoft.SystemCenter.ConfigMgr.Setup.DatabasePage.ValidatePage()
       à Microsoft.SystemCenter.ConfigMgr.SetupFramework.WizardForm.ActivatePage(String pageId, Boolean goingNext)
       à System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       à System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       à System.Windows.Controls.Button.OnClick()
       à System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
       à System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       à System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       à System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
       à System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
       à System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       à System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       à System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       à System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       à System.Windows.Input.InputManager.ProcessStagingArea()
       à System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       à System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
       à System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
       à System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       à System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       à MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       à MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       à System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
       à System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)].
    Please help me; I'm driving crazy.
    Kévin KISOKA - MCTS Exchange Configuring, MCTS Hyper-V Server Virtualization

    3 Steps are neccessary:
    1. Make sure the Windows Firewall Service on the SQL Server is running and set to automatic
    2. Add the SQL EXE as a Program Exception to the Firewall on the SQL Server:
    To add a program exception to the firewall using the Windows Firewall item in Control Panel.
    - On the Exceptions tab of the Windows Firewall item in Control Panel, click
    Add a program.
    - Browse to the location of the instance of SQL Server that you want to allow through the firewall, for example
    C:\Program Files\Microsoft SQL Server\MSSQL11.<instance_name>\MSSQL\Binn, select
    sqlservr.exe, and then click Open
    - Click OK.
    From http://technet.microsoft.com/en-us/library/cc646023.aspx
    3. The last step neccessary, on the SQL Server, is to set File and Printer Sharing "on". When this is off, the following error occurs: "Network Path was not found"

  • SCCM 2012 PowerShell script gets progressively slower with each machine added to a collection

    Firstly, I hope this question firs in this forum.
    I have a PowerShell script that I created the imports a CSV file and adds the machine names to a collection as a direct membership. There are 5000 machines total in the list. When the script first starts, the average per machine is just a few tenths of a
    second. Once it reaches about 10% the average is up to almost 4 seconds and that time is getting larger with each machine. I tried using the CMDLets for SCCM but they were even slower than the WMI seemed to be.
    What is the reason for this increase?
    Is there anything I can do to not have this happen?
    My script:
    $ErrorActionPreference= 'continue'
    $FilesInFolder = Get-ChildItem $PSScriptRoot
    $CSVFiles = $FilesInFolder | where {$_.extension -eq ".csv"}
    $SiteCode = "US1"
    Function AddToCollection-WithWMI
    ForEach ($File in $CSVFiles)
    $CollectionStart = Get-Date
    $CollectionName = $File.Name.TrimEnd(".csv")
    $PClist = Import-CSV $File.FullName
    Write-Host "Populating Collection: " $CollectionName
    $i = 1
    $PCRollingTime = New-Object System.TimeSpan
    ForEach($PC in $PClist)
    $PCStart = Get-Date
    $ResourceName = $PC.SerialNumber
    Write-Host $i "of" $PClist.Count
    $ResourceQuery = Get-WmiObject -Namespace "Root\SMS\Site_US1" -Class SMS_R_SYSTEM -Filter "Name = '$ResourceName'"
    $CollectionQuery = Get-WmiObject -Namespace "Root\SMS\Site_US1" -Class SMS_Collection -Filter "Name = '$CollectionName' and CollectionType='2'"
    $CollectionQuery.Get()
    IF($ResourceQuery -ne $null)
    #Create new direct membership rule
    $NewRule = ([WMIClass]"\\Localhost\root\SMS\Site_US1:SMS_CollectionRuleDirect").CreateInstance()
    $NewRule.ResourceClassName = "SMS_R_System"
    $NewRule.ResourceID = $ResourceQuery.ResourceID
    $NewRule.Rulename = $ResourceQuery.Name
    #Commit changes
    $CollectionQuery.CollectionRules += $NewRule.psobject.baseobject
    $CollectionQuery.Put() | Out-Null
    $NewRule = $null
    ELSE
    Write-Host "No Device ID found for: " $PC.SerialNumber
    $CollectionQuery = $null
    $ResourceQuery = $null
    $PCFinish = Get-Date
    $TimeSpan = New-TimeSpan -Start $PCStart -End $PCFinish
    $PCRollingTime = $TimeSpan + $PCRollingTime
    If(($i % 25) -eq 0)
    $CurrentAvgPerPC = $PCRollingTime.TotalSeconds / $i
    Write-Host "The current average is" $CurrentAvgPerPC "seconds."
    $SecondsToETA = ($CurrentAvgPerPC * ($PClist.Count - $i))
    $ETA = Get-Date
    $ETA = $ETA.AddSeconds($SecondsToETA)
    Write-Host "The Estimated time of complete is" $ETA
    If(($i % 250) -eq 0)
    $PCRollingTime
    $i++
    $CollectionQuery = Get-WmiObject -Namespace "Root\SMS\Site_US1" -Class SMS_Collection -Filter "Name = '$CollectionName' and CollectionType='2'"
    $CollectionQuery.Get()
    #Initiate the collection evaluator
    $CollectionQuery.RequestRefresh()
    $CollectionFinish = Get-Date
    AddToCollection-WithWMI

    I haven't checked the complete code, but it doesn't look very efficient. For example I would take the collection query out the loop for all the pcs, simply because it's always the same and would save you about 4999 queries.
    My Blog: http://www.petervanderwoude.nl/
    Follow me on twitter: pvanderwoude
    ^^ This 
    Additionally, you could likely replace most of the WMI calls you do with the built in SCCM PowerShell cmdlets.  The two lines below will check to see if a Device Object for a specific PC exists and if it does, adds it to your collection
    $PCID = Get-CMDevice -Name $PC.SerialNumber
    if ($PCID -ne $null) {
    Add-CMDeviceCollectionDirectMembershipRule -CollectionName $CollectionName -ResourceId $PCID
    If you want to check to see if the collection exists before trying to add devices to it, you can use the Get-CMDeviceCollection cmdlet.
    Get-CMDeviceCollection -Name $CollectionName
    Moo.

Maybe you are looking for