
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2017 12:24 AM
Hi All
Anyone able to set account expiration date from Orchestration? We are trying to set it from custom PowerShell activity but it is not working. Please find the below command we used.
Our Target host is MID Server, AD server and MID server both are on the same network. Even though the commands are not working, the activity is running for a long time without showing any error or success. I had to cancel the activity all the time. Do you find any issue in this command?
Regards,
Vivek
Solved! Go to Solution.
- Labels:
-
Orchestration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-21-2017 06:12 AM
Hi All,
The issue is resolved now. I tried running MID Server service with the Credential which I am using in ServiceNow. After that, it worked.
Regards,
Vivek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2017 01:01 AM
Hi Vivek,
I used the below script for user1 as samaccountname
Set-ADAccountExpiration "user1" -DateTime "02/20/2017"
The date should be in this format
var termDate = month+'/'+day+'/'+year;
This has worked for me.
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2017 02:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2017 02:54 AM
Hi Vivek,
Just check on community or powershell specific error messages. I didn't face such type of issue.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2017 03:21 AM
Your error message mentions "insufficient access rights to perform the operation" - doesn't that indicate that the account running the PowerShell script may not have sufficient privileges...?