Jump to content


BryanP

Script deployed by SCCM, writing file to network

Recommended Posts

I'm trying to run a script against my computers with SCCM.  It's a very simple powershell script (it has to be, I'm not much of a scripter), and it works perfectly from the command line.  However, when I try to deploy it from SCCM it fails every time.  I've tried writing directly to the share, I've tried mapping a drive, I've tried deploying it with admin rights and using the logged in user's rights. 

I'm hoping someone here can tell me what I'm doing wrong.  The script is below.  I know it works, but I don't know why I can't deploy it.

 

# Write the value of the AutoAdminLogon key to $val

$val = Get-ItemProperty -Path "hklm:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name "AutoAdminLogon"

 

# If the AutoAdminLogon key information exists and it is anything other than 0
# write that information to a file on a network share.
# File will be <computername>.txt

    if($val)
    {

if($val.AutoAdminLogon -ne 0)

        {
        $val | Out-File \\<sharelocation>
\AutoAdminLogonLog\$env:COMPUTERNAME.txt"
        }
    }

 

Share this post


Link to post
Share on other sites

I've been trying to follow those instructions, but when I get to the final step I get an error about "No valid classes or settings were found to import from the MOF file." 

I've gone back through the instructions to make sure I was following them exactly, not missing any characters on the copy & paste, etc, but I get the same results.

Any suggestions?

Share this post


Link to post
Share on other sites

Without out your mof edits there isn't much anyone can do to help. So post them.

 

Keep in mind that many of us will be out at Mmsmoa.com next week. so expect delayed replies. my flight leaves at 6 am tomorrow. :-) :-(

Share this post


Link to post
Share on other sites

Sorry it took so long to get back to this.  I had several things come up that pushed this way down my list of priorities at work for the last week or so. 

I've gone through the entire process again today and I'm getting the same results.  I've attached these files:

 

configuration.mof - this is the untouched configuration.mof file in my inboxes\clifiles.src\hinv folder.

RegKeyToMof_WinLogon.txt - This contains the output of the configuration.mof tab of RegKeyToMof after I selected SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon, and changed the Group label to Custom_Registry.

RCM.mof - this contains the output from the to import in Admin/AgentSettings/HardwareInventory/SetClasses/Import tab

appended_configuration.mof - this is the configuration.mof file listed above with the content of RegKeyToMof_WinLogon.txt appended, in case you need to make sure I didn't screw that up.

Any help is appreciated.  Including "Oh, you might want to click that first ya idjit." 

 

appended_configuration.mof

configuration.mof

RCM.mof

RegKeyToMof_WinLogon.txt

Share this post


Link to post
Share on other sites

I just imported the RCM.mof and it imports without issues and I'm seeing data in my test lab using these mof edits.

 

Share this post


Link to post
Share on other sites

I'm still getting the same error, but at least now I know it's probably something I'm doing wrong.

I haven't had time to look at this, it's been kind crazy here (except that crazy is normal).  I'm about to be gone for a week, and at least for the moment the urgency on this has dropped. 

I'll work on it some more when I get back and hopefully I can figure it out.  Thanks for the help.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...