Skip to content

Call Windows prompt for credentials with Python through PowerShell command Get-Credential.

Notifications You must be signed in to change notification settings

pan-vlados/clixmlcreds

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clixmlcreds

Simple solution to call Windows prompt for credentials through PowerShell command Get-Credential. Result of command above will be exported in xml using Windows Data Protection API (Export-Clixml PowerShell command). Allow you to store your credentials and reuse it in scripts by CredentialManager.read(...).

Usage

from credentials import Credential, CredentialManager


if not Credential.exists(name='Name_of_secret_xml_file'):
    CredentialManager.write(
        cred_name='Name_of_secret_xml_file',
        username='Your_username',
        prompt_message='Input username and password:'
    )
cred = CredentialManager.read(cred_name='Name_of_secret_xml_file')
username = cred.username
password = cred.get_password()  # return unsecure password string

About

Call Windows prompt for credentials with Python through PowerShell command Get-Credential.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published