How to use WMIC is a batch file to trigger SCCM actions?

Author Message
bmair

  • Total Posts : 291
  • Scores: 0
  • Reward points : 22680
  • Joined: 3/3/2003
  • Location: Da Bronx
  • Status: offline
How to use WMIC is a batch file to trigger SCCM actions? Friday, February 10, 2012 1:36 PM (permalink)
0
Hello All,
    First a little background:  I have the Right-click tools installed.  However, it doesn't work on all my subnets - make that most of my subnets.  That is, if for example, I try to initiate a Machine Policy Retrieval & Evaluation Cycle Action, it will work on clients in a particular subnet, but fail wit hthe "RPC server unavailable..." error on others.
   So, I was thinking of using PSExec to copy a batch file to a problem client and run the command using WMIC:
WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000022}" /NOINTERACTIVE
The problem is that when I try it, it actually connects and inputs the command, but sits there.  As soon as I use Control+C (Exit won't kill the session), the command is triggered and I get the desired result.
So, I'd liek to ask how can I write the batch file so the actually kicks off the TriggerSchedule action?  I've looked at other batch files that use the WMIC, but don't seee any extra commands that could give me a clue.
Also, trying to get the issue of what's stopping the tool on those subnets solved is a non-starter for the moment.  It'd take many months (if ever) to get it done, from what I am seeing.
Thanks,
Bancroft
Affiliated Computer Services, Inc.
Information Management Senior Analyst
New York, New York
 
#1
    bmason505

    • Total Posts : 3027
    • Scores: 214
    • Reward points : 55860
    • Joined: 1/23/2003
    • Location: Minneapolis, MN
    • Status: offline
    Re:How to use WMIC is a batch file to trigger SCCM actions? Friday, February 10, 2012 1:54 PM (permalink)
    0
    Why complicate it with PSEXEC? WMIC does remote on its own.
    WMIC /node:Computername /namespace:\\root\ccm blah blah blah
    Brian Mason
    MCSA\MCSE\MS MVP - ConfigMgr
    http://www.mnscug.org/
     
    #2
      bmair

      • Total Posts : 291
      • Scores: 0
      • Reward points : 22680
      • Joined: 3/3/2003
      • Location: Da Bronx
      • Status: offline
      Re:How to use WMIC is a batch file to trigger SCCM actions? Friday, February 10, 2012 2:22 PM (permalink)
      0
      bmason, that was my first thought, as well.  But, the command returned the same "RPC server unavilable" error.   I think that on some of these subnets, any attempt to connect directly to WMI on the clients is blocked.  I get the same behavior and error when trying to use SCCM Client Center as well.
         So, I figured, it I had a way to run the command locally on the target, that it might work.  Clunky? Yes, but at least I'd be able to reach these clients and get what I want done.
      Bancroft
      Affiliated Computer Services, Inc.
      Information Management Senior Analyst
      New York, New York
       
      #3
        bmason505

        • Total Posts : 3027
        • Scores: 214
        • Reward points : 55860
        • Joined: 1/23/2003
        • Location: Minneapolis, MN
        • Status: offline
        Re:How to use WMIC is a batch file to trigger SCCM actions? Friday, February 10, 2012 4:00 PM (permalink)
        0
        Maybe remote into one and hit the rest from there.  I wonder what all they're blocking.  Also, do you run a GPO health startup script?
        Brian Mason
        MCSA\MCSE\MS MVP - ConfigMgr
        http://www.mnscug.org/
         
        #4
          bmair

          • Total Posts : 291
          • Scores: 0
          • Reward points : 22680
          • Joined: 3/3/2003
          • Location: Da Bronx
          • Status: offline
          Re:How to use WMIC is a batch file to trigger SCCM actions? Monday, February 13, 2012 9:11 AM (permalink)
          0
          Maybe remote into one and hit the rest from there.
          I can't do that since the users cannot be "disturbed".
           
          I wonder what all they're blocking.
          So do I.  But, trying to get to the root cause would take me forever, so that is why I am looking for a viable workaround.
           
          Also, do you run a GPO health startup script?
          No, they don't have one running in the environment.  That is another thing I am trying to get added.  Also trying to get them to use SC Software Updates Manager.
           
          That said, any ideas of how I can get this little script to work?  Again, the script connects to the remote PC, but it won't run until I press Control+C to abort it.  Otherwsie, I just see the command line and nothing  happens.
          Bancroft
          Affiliated Computer Services, Inc.
          Information Management Senior Analyst
          New York, New York
           
          #5
            CAP

            • Total Posts : 91
            • Scores: -2
            • Reward points : 13780
            • Joined: 12/9/2011
            • Status: offline
            Re:How to use WMIC is a batch file to trigger SCCM actions? Monday, February 13, 2012 10:26 AM (permalink)
            0
            you could psexec to one of them remotely and get their command prompt and hit the rest with out bothering the user.
            psexec -u account -p password cmd.exe /c cmd.exe
            then run your batch.
            Carl Polk
             
            #6
              Online Bookmarks Sharing: Share/Bookmark

              Jump to:

              Current active users

              There are 0 members and 1 guests.

              Icon Legend and Permission

              • New Messages
              • No New Messages
              • Hot Topic w/ New Messages
              • Hot Topic w/o New Messages
              • Locked w/ New Messages
              • Locked w/o New Messages
              • Read Message
              • Post New Thread
              • Reply to message
              • Post New Poll
              • Submit Vote
              • Post reward post
              • Delete my own posts
              • Delete my own threads
              • Rate post

              2000-2012 ASPPlayground.NET Forum Version 3.9