Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Calling all scripters - can't get PowerShell script to run when user logged out

$
0
0

Morning Spiceheads

I am setting up a PowerShell script to run to alert non-domain users that their password is soon to expire (as directed on this thread http://community.spiceworks.com/topic/342773-how-to-give-users-a-password-expir-prompt-on-a-device-not-part-of-the-domain). I am currently thoroughly testing this on a test lab before putting it live in my 1000 user organization.

My script runs perfectly using Task Scheduler, when the Administrator account is logged in. But I need this to run seamlessly with no users logged on. Unfortunately I cannot get this to work for the life of me (Error Value: 2147943785). This is what I have tried so far:

1. On Task Scheduler, Run whether user is logged on or not is ticked, with the domain Administrator entered as the credential (bare in mind this machine is a Domain Controller)

2. On Task Scheduler, Run with highest privileges tried ticked and unticked

3. Logon as a batch job is greyed out in Local Security Policy, so went into Group Policy Management and enabled the user batch logon rights there, still no cigar

4. I also enabled Allow logon locally for the user

5. I tried using a different user with Administrative rights

I am running out of things to try, I'm sure I'm missing something pretty basic here. Hoping some script wizz or Group Policy god could help me out here. See attached the error I am getting, this tells me that I haven't got my Logon as batch rights correct, but I'm sure they are!

I am using Windows Server 2008 R2.

Please help.

Kind regards

Michael


Viewing all articles
Browse latest Browse all 15370

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>