run powershell scripts with service account + profile

Author Message
Bezerk

  • Total Posts : 22
  • Scores: 0
  • Reward points : 0
  • Joined: 6/21/2005
  • Location: Netherlands
  • Status: offline
run powershell scripts with service account + profile Saturday, May 17, 2008 12:37 AM (permalink)
0
I want to run powershell scripts with a service account. That's no problem exept that the objects i want to use i have to add-pssnapin in the profile to get some cmd-lets to work. Do i need a custom profile wih i can refere to when i run scripts with the service account?
And furthermore i need to read a file that will have a username and password, so i can login in to some services. How can i protect the file or encrypt it so i can use it in the scripts?
 
Thanks in advance.
 
#1
    SAPIENScripter

    • Total Posts : 283
    • Scores: 2
    • Reward points : 0
    • Joined: 11/1/2006
    • Location: SAPIEN Technologies
    • Status: offline
    RE: run powershell scripts with service account + profile Sunday, June 01, 2008 3:17 PM (permalink)
    0
    Your service account will likely need a profile script just like a regular user.  Or simply add the commands to your script. Is this part of a scheduled task?  How is the service account running the script? If you don't have a "real" person running the script then there's no way to enter a password. If you absolutely have to embed credentials, then consider packaging your script with a product like PrimalScript.
    Jeffery Hicks
    Windows PowerShell MVP
    SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com

    Follow Me: http://www.twitter.com/JeffHicks
     
    #2

      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