Giter VIP home page Giter VIP logo

powershell_credential_manager's People

Contributors

techgerm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

powershell_credential_manager's Issues

UserName Parameter in New-StoredCredential does not store the username correctly.

UserName Parameter in New-StoredCredential does not store the username correctly.

To replicate:

  1. Run the following New-StoredCredential -Password mypassword -Persist ENTERPRISE -Target TestNewCred -Type GENERIC -UserName TestUser
  2. Run Get-StoredCredential and you will see a new credential was created but using the current username ($env:Username) instead of the credential specified with the UserName param

Improve Password Generation

Develop a method to generate passwords in a more customizable way to replace System.Web.Security.Membership.GeneratePassword

Get-StrongPassword -NumberOfSpecialCharacters

Get-StrongPassword -NumberOfSpecialCharacters

Says default value is 3
If i use any value less than 5 (0,1,2,3,4) it seems to return 5 (or more) special characters

0..4 | foreach-object {[pscustomobject]@{'NumSpecial' = $_; 'Password' = Get-StrongPassword -Length 20 -NumberOfSpecialCharacters $_}}

NumSpecial Password
0 JN}ts#!^FycNj[9E]5;&
1 5sIV76]2!oZ>prk9d(P
2 23n8U.}_{kZGzj-ClUbE
3 ]hUPY-QS^Q2cVi
Gk!jf
4 4E>O[FrM]d}@A5qKFv4H

so what is considered a special character
0 has 8, 1 has 5, 2 has 5, 3 has 5, 4 has 5

Not compatible with PowerShell Core

I get the following error with New-StoredCredential on PowerShell Core 7.

New-StoredCredential : Argument 'New-StoredCredential' is not recognized as a cmdlet: Could not load type 'System.Web.Security.Membership' from assembly 'System
.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

The other cmdlets work in Core. All cmdlets work in PowerShell 5.

Credentials not stored after reboot

Hello,
When I create a credential using New-Storedcredential, I see it is creating it. I can then fetch it using Get-Storedcredential and it returns to me the credentials.

But when I reboot windows and run Get-Storedcredential, it is gone. What can I do about it? It seems it is not really saving it in the credential manager?

Running New-StoredCredential over WinRM produce error

Hi,

I'm trying to execute the New-StoredCredential over WinRM session, and I'm getting this error:

ERROR: CredWrite failed with the error code 1312.
windows-2016-x64-virtualbox: ERROR: at , C:\Users\vagrant\set-proxy.ps1: line 22 ERROR: at , : line 1
windows-2016-x64-virtualbox: ERROR EXCEPTION: System.Exception: CredWrite failed with the error code 1312. ERROR EXCEPTION: at PSCredentialManager.Api.CredentialManager.WriteCred(NativeCredential credential) ERROR EXCEPTION: at PSCredentialManager.Cmdlet.NewStoredCredential.ProcessRecord()

This is the snippet I was running:

Write-Host "Setting credential manager"
Import-Module CredentialManager
New-StoredCredential -Target $env:PROXY_HOST -UserName $env:PROXY_USERNAME -Password $env:PROXY_PASSWORD -Type GENERIC -Persist ENTERPRISE

Is there any way I can work around this restriction?

Thank you

New-StoredCredential should also accept securestring as password

I currently do this boilerplate:

try { $cred = Get-StoredCredential $url } catch {}
if ($cred -eq $null) {
    $user = Read-Host -Prompt "Username ($Env:USERDOMAIN\$Env:USERNAME)"
    $pass = Read-Host -Prompt "Password" -AsSecureString
    $cred = New-Object System.Net.NetworkCredential('', $pass)
    New-StoredCredential -Target $url $cred.password
    Remove-Variable cred
}

It would also be easier if Get-StoredCredential would use non terminating error so we could use -ea o instead of try/catch block:

$c = Get-StoredCredential $url -ea 0
if (!$c) {...}

Why the 512-byte length limit on passwords?

I would like to use CredentialManager to save PEM-format RSA private key data (typically a few thousand bytes), but there is an explicit 512-char length limit in the module code. Is that from an underlying Window Credential Manager limitation?

how build it?

somebody know how build it? i cant find reference Microsoft.QualityTools.Testing.Fakes and PSCredentialManager.Api.Fakes

Import error

Will this work with Windows 10 and Powershell 5? I get an error when attempting to import. It says it can't load the file or assembly CredentialManager.dll and that the operation isn't supported.

PowerShell gallery appears outdated

It appears that the last version published to the PSGallery was on 2015-09-07, and that several useful additions have been done since.

Could you push an update 2.0 to the Powershell gallery ?
Publication of the updates to the Gallery would allow me to reference and auto-download your module from scripts I publish there, rather than having to fork and include them in my own modules.

ExportedCommands empty on some machines

Hi ! Thx for that module that helped us a lot !

We have some machines, though, that import the module but have the exportedCommands empty after the import-module.

We used the module on more than 5k computers and only around 10% are failing to get ExportedCommands and thus fail to use the module.

Do you have any idea why only some machines are having this issues ? they all are installed by the same base image and get updated the same way.

Let me know if you need any aditionnal information or if you want me to test something.

Many thanks in advance !

Remove-StoredCredential non-functional

Expected behavior:

Get-StoredCredential -Filter myusername | Remove-StoredCredential

Cannot get Remove-StoredCredential to work in any aspect. With or without parameters.

Add autocomplete support for -Target

It would be nice if the -Target property supported autocomplete. Is this something you'd consider accepting a PR for?

(I've previously implemented custom autocompletion for host names in my PsHosts module)

Licensing question

Hi Dave,

First of all, this module looks pretty sweet! I tried it out and it worked like a charm.

In terms of licensing, I wonder why you chose to go with GPL? This has come up as an issue at work in the past. The fear and uncertainty of GPL licensed code is enough to make me think twice about using it at my day job. If nothing else, I'm never going to be knowledgeable enough of the legal implications to feel confident that its worth the risk. Its obviously perfectly fine to install the module on a machine and use it, but what about tools that might take it as a dependency, or bundle it or repackage it in some way?

Anyway, I'm sure I'm not the only person who will ever encounter this question, so I just wanted to make sure you had considered this when choosing the license. Feel free to ignore this or close it as you see fit...

-Bryan

Documentation Specifies LOCAL_MACHINE, looks like Enumerator name is actually LocalMachine

Documentation link showing LOCAL_MACHINE: https://github.com/davotronic5000/PowerShell_Credential_Manager/wiki/New-StoredCredential

Error when using LOCAL_MACHINE:

PS C:\WINDOWS\system32> New-StoredCredential -Target O365 -UserName [email protected] -Persist LOCAL_MACHINE -Password mySuperSecretPassword
New-StoredCredential : Cannot bind parameter 'Persist'. Cannot convert value
"LOCAL_MACHINE" to type "PSCredentialManager.Common.Enum.CredPersist". Error:
"Unable to match the identifier name LOCAL_MACHINE to a valid enumerator name.
Specify one of the following enumerator names and try again:
Session, LocalMachine, Enterprise"
At line:1 char:82
+ ...  -UserName [email protected] -Persist LOCAL_MACHINE -Passwo ...
+                                                     ~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [New-StoredCredential], Par
   ameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,PSCredentialManag
   er.Cmdlet.NewStoredCredential

Switched to LocalMachine as indicated by error message, working now.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.