Windows 10: How To Set Log On As Credentials for a Service via Powershell

Discus and support How To Set Log On As Credentials for a Service via Powershell in Windows 10 Software and Apps to solve the problem; Hi there,I would like to create a script in PowerShell that facilitates people to change the Log On As information for a specific Service with local... Discussion in 'Windows 10 Software and Apps' started by AndyDeeGee88, Oct 15, 2021.

  1. How To Set Log On As Credentials for a Service via Powershell


    Hi there,I would like to create a script in PowerShell that facilitates people to change the Log On As information for a specific Service with local admin passwords.There is an app, for Dell computers, called SupportAssist. This app only works when logged in with a local administrator session but on the Dell community I have found out that with a little trick, you can get it working also when logged in as a normal user with no admin rights: https://www.dell.com/community/SupportAssist-for-PCs/SupportAssist-run-as-admin/td-p/7187490Run Services as administrator Type the local admin credential

    :)
     
    AndyDeeGee88, Oct 15, 2021
    #1
  2. Ryan Fra Win User

    Windows Network Credentials

    Hi Keith,

    We suggest that you disable Credential Manager before mapping your Drives. Please follow these steps to disable Credential Manager:

    • In the search box type “Services
    • Right click on “Services” and select “Run as Administrator
    • In the Services Window, look for Credential Manager Service and click “Stop”.
    • Restart the computer and go back the Credential Manager Service and set it to “Automatic”.
    • Restart the computer again.

    Please keep us updated if you were able to map your drives.
     
    Ryan Fra, Oct 15, 2021
    #2
  3. Joa Flinn Win User
    Windows Service stored credential security

    Hello all,

    Recently I set a particular service (the service for Dell Support Assistant) to run as administrator on an on-domain computer for a non-admin user. This was accomplished via a remote session where I opened services.msc, found the corresponding service, went
    to properties > log on tab, picked This account and entered the administrator credentials.

    I was wondering, however, if this is a secure thing to do.

    Not really worried about the user being able to retrieve the password (on top of the user being neither tech-savvy nor malicious)

    • The credentials are not stored in the Windows Credentials manager. Even if it would be, the user is unable to view or copy the password.
    • The username is stored in the registry under HKLM\SYSTEM\CurrentControlSet\Services\<Service> in the Object Name key. Not the password, however.

    However, I also have to consider the possibility of a system compromise, however unlikely. Reading around, it looks like the passwords are encrypted in some fashion.

    • When configuring a Windows service to run as a different account, the Service Control Manager uses the LsaStorePrivateData and
      LsaRetrievePrivateData function to store and retrieve the password.
    • Decryption does seem possible, though I'm not quite capable of wrapping my head around the process of doing so or the measures I can take against it. I read this rather involved article (https://devblogs.microsoft.com/scripting/use-powershell-to-decrypt-lsa-secrets-from-the-registry/)
      on decrypting LSA passwords with PowerShell, might also be possible with the NirSoft LSASecretsView application (though I'm not sure this can be done without already having administrative privileges available).

    If anyone has more knowledge on this specific topic, I'd be happy to hear your recommendation.

    Cheers
     
    Joa Flinn, Oct 15, 2021
    #3
  4. Brink Win User

    How To Set Log On As Credentials for a Service via Powershell

    Credential Guard lab companion


    Source: Credential Guard lab companion Datacenter and Private Cloud Security Blog


    See also:
     
    Brink, Oct 15, 2021
    #4
Thema:

How To Set Log On As Credentials for a Service via Powershell

Loading...
  1. How To Set Log On As Credentials for a Service via Powershell - Similar Threads - Set Log Credentials

  2. Problems with Powershell Scripts and Credential Manager VIA Intune

    in Windows 10 Gaming
    Problems with Powershell Scripts and Credential Manager VIA Intune: Hi All,I have been trying to create either a script for entering credentials into Windows Credential Manager via Intune. Credentials are for a mapped drive connection to a non-windows server. Have not been able to make it work yet. I have tried many permutations of scripts,...
  3. Problems with Powershell Scripts and Credential Manager

    in Windows 10 Software and Apps
    Problems with Powershell Scripts and Credential Manager: Hi All,I have been trying to create either a script for entering credentials into Windows Credential Manager via Intune. Credentials are for a mapped drive connection to a non-windows server. Have not been able to make it work yet. I have tried many permutations of scripts,...
  4. View Services on Remote Server via PowerShell

    in Windows 10 Gaming
    View Services on Remote Server via PowerShell: Looking to grant a service account access to run the get-services cmd let for remote servers. I have amended few permission still getting elevated privilege error on PowerShell....
  5. View Services on Remote Server via PowerShell

    in Windows 10 Software and Apps
    View Services on Remote Server via PowerShell: Looking to grant a service account access to run the get-services cmd let for remote servers. I have amended few permission still getting elevated privilege error on PowerShell....
  6. How To Set Log On As Credentials for a Service via Powershell

    in Windows 10 Gaming
    How To Set Log On As Credentials for a Service via Powershell: Hi there,I would like to create a script in PowerShell that facilitates people to change the Log On As information for a specific Service with local admin passwords.There is an app, for Dell computers, called SupportAssist. This app only works when logged in with a local...
  7. How To Set Log On As Credentials for a Service via Powershell

    in Windows 10 Customization
    How To Set Log On As Credentials for a Service via Powershell: Hi there,I would like to create a script in PowerShell that facilitates people to change the Log On As information for a specific Service with local admin passwords.There is an app, for Dell computers, called SupportAssist. This app only works when logged in with a local...
  8. How to disable and remove a PIN via Powershell

    in Windows Hello & Lockscreen
    How to disable and remove a PIN via Powershell: Hi All Not a question but an Answer, took me a while to figure out how I could remove and disable a Windows Hello for Business PIN via powershell. It's pretty simple actually, You can disable the PIN with the below two commands. Set-ItemProperty...
  9. Can you remove VPN credentials via CMD or PowerShell

    in Windows 10 Ask Insider
    Can you remove VPN credentials via CMD or PowerShell: We have clients that use the Built in Windows VPN client. They save their credentials then their password changes and they cannot figure out how to remove the credentials so that they can use the new password. Is there a way to clear the saved credentials for Windows VPN...
  10. cleanmgr.exe via Powershell

    in Windows 10 Support
    cleanmgr.exe via Powershell: Hello, I would like to hear some tips on how to fix the PowerShell script. Generally, it works fine but I want to add something like a timer that I can run a script and it will stop in 15 min anyway! (that the time, when 'clearmgr' usually will complete the task) Why I need...