Learn to securely use Passwords with PowerShell

Поділитися
Вставка
  • Опубліковано 15 жов 2024

КОМЕНТАРІ • 111

  • @michaelzander7919
    @michaelzander7919 6 років тому +1

    I have been a Mainframe Software Developer for 52+ years. I am now trying to learn PowerShell. (Old dog, ... new tricks) Your PowerShell videos are excellent. Thank you for teaching an old dog new tricks! You make it so easy to learn new 'stuff'...

    • @ShanesCows
      @ShanesCows  6 років тому

      Glad I could help. Mainframe stuff is classic. Very cool. Hopefully PowerShell lives up to what you want.

  • @NancyRileyNuniverse
    @NancyRileyNuniverse 7 років тому +6

    Great lessons, Shane Young! I love your training style and look forward to watching all of your videos!!! Thanks again.

  • @evenblindern9300
    @evenblindern9300 4 роки тому +1

    Talking about delivering the right stuff on time. 3 x hurrah for Shane!

    • @ShanesCows
      @ShanesCows  4 роки тому

      Thanks Even. There are about 40 more videos to follow to help you keep learning.

  • @ImEddieful
    @ImEddieful 5 років тому +3

    Hey Shane, thanks for your help. I really appreciate your explanations, and guidance!

  • @vicrao100
    @vicrao100 6 років тому +2

    Thank you for making this video. This video is an example of how a proper instructional video should look like. I'll check out your other videos when I get a chance.

  • @funhurtsmylungs1056
    @funhurtsmylungs1056 7 років тому +1

    Good video! We use the hash way but slightly differently. We use it for calling new PSSessions on older versions of SharePoint, like this:
    $pw = Convert-SecureString -force -String "00110000cdsds"
    $cred = New-Object -typename system.management.autoamtion.PSCredential("Domain\user", $pw)
    Your way is MUCH easier! Totally going to be using a "safe"

    • @ShanesCows
      @ShanesCows  7 років тому

      Thanks for sharing, I knew you could do something like that but never worked through it. I think that is the tough thing about passwords for people who are new or not super strong with PowerShell. There are soo many options. That is why I threw together some of my favorites. Try to give a bunch of options in one place. :) Thanks again.

  • @mynameisgogo
    @mynameisgogo Рік тому +1

    Fantastic Explanation ! Thanks Shane

  • @dinroot01
    @dinroot01 3 роки тому +1

    Wonderful.. just what I looking for thanks a lot Mr Shane!!

  • @skynyrd26
    @skynyrd26 7 років тому +4

    Good Stuff! Thanks your video gave me some solutions for some of my scripts

  • @coolname-pf2xh
    @coolname-pf2xh 2 роки тому +1

    The second method is very useful. thank you.

  • @DannyNilsson
    @DannyNilsson 5 років тому +1

    i was wondering myself about this security thing and password storing, and was coming up with the same solutions, but i didn't know about the credentials manager part. but i see this also requires that you login as the user, and creates the creds. The thing is, i guess its not then possible to use MSA Manage Service accounts to run the task scheduler.
    i also think for easier creating the encrypted xml, it should be possible to do a invoke-command as a different user, to not need logging out, where it gets easier to manage.
    And for the secure folder. NTFS permission also needs to be added as well.

  • @nahassalahudin
    @nahassalahudin 7 років тому +4

    Excellent video, thanks for doing this...

  • @GeeRoos1002
    @GeeRoos1002 5 років тому +2

    Hi Shane, love the videos. Tough question: If I wanted to deploy a package to run a PowerShell script silently via SCCM, the script will run as LocalSystem. If I need to pass credentials to the script to access a file share, any good way of obfuscating the password?

    • @ShanesCows
      @ShanesCows  5 років тому +1

      Not sure. 😑 I am sure there is but I haven’t done it before so I am not much help.

  • @stefanspinu1637
    @stefanspinu1637 5 років тому +4

    amazing content! Please keep up the good work - subscribed + enabled the bell icon, of course

  • @beergood83
    @beergood83 3 роки тому +1

    Thank you for your videos you are one of a handful of accounts I subscribe to.

    • @ShanesCows
      @ShanesCows  3 роки тому

      Awesome 🤩 Thanks for the support

  • @HarwoodGuy
    @HarwoodGuy 5 років тому +1

    You are a star, I’m totally new to PS 😀

  • @DavidGonzalez-mq6mp
    @DavidGonzalez-mq6mp Рік тому +1

    Great video. I am urgently looking for a solution to a problem and I'm wondering if you can tell me if Windows Credentials Manager can be adopted to it. I have an executable that requires the user name and password strings to be passed to it as command-line arguments. For example: MyExecutable.exe /user:{UserNameString or variable} /password:{PasswordString or variable}. How do I retreive the strings from Windows Credentials Manager and pass them as a string or a variable containing the string? Your assistance would be most appreciated.

    • @ShanesCows
      @ShanesCows  Рік тому

      Hey David - I haven't tried before but I would have guessed the credential manager credential cmdlets I show at the end of the video can do this. But not positive. Sorry I am not more help.

  • @יניבדודיאן
    @יניבדודיאן 4 роки тому

    Hello Shane, this is great stuff i couldnt find anywhere. Thank you very much

  • @sugato58
    @sugato58 5 років тому +1

    I just loved the video Thank you very much Sir !! You are awesome !!

  • @sergioc.5665
    @sergioc.5665 4 роки тому +1

    Great video as always... was wondering (probably not) if there's an equivalent workaround for modern authentication (2FA). When I use the CredentialManager method, I was hoping that it would at least get past the credentials part of the authentication and would only be waiting for me to approve (2FA) the login from the authenticator app, but it just brings up the login screen and I still have to manually enter the credentials.

    • @ShanesCows
      @ShanesCows  4 роки тому

      Great question. I don’t know though. 😐

  • @svwoudenberg
    @svwoudenberg 5 років тому +2

    Hey Shane. Great to get started with your videos omn powershell. My question is how to pass an password to e.g. a 7zip encription command ion a command line.
    Best!
    Sander (Netherlands)

    • @ShanesCows
      @ShanesCows  5 років тому

      Not sure. Never have done it. Sorry.

    • @DannyNilsson
      @DannyNilsson 5 років тому

      You just don't do that as 7zip would require some sort of API or why of writing to the software. Powershell and .Net has compress functions, but don't know if they are support the encryption part.

  • @tonygreen1067
    @tonygreen1067 Рік тому +1

    Is there an updated link to the source code? "Link to download the PowerShell from the video" is broken.

    • @ShanesCows
      @ShanesCows  Рік тому

      Hey Tony the web site I hosted in started charging too much. I don’t have any of the code anymore. Sorry 😔

  • @AlexSanDiNero
    @AlexSanDiNero 3 роки тому +1

    That was Gangsta.... Thank you!

  • @eivenhoe
    @eivenhoe 3 роки тому +1

    Good Stuff Shane

  • @AlexSanDiNero
    @AlexSanDiNero 3 роки тому +1

    This doesn't seem to work when I'm using MFA though. Any suggestions, sir?

    • @ShanesCows
      @ShanesCows  3 роки тому

      I don’t. Sorry. I am sure there are options. If you tweet me @shanescows I can try to help you find the answer.

  • @omrelaxmusic1000
    @omrelaxmusic1000 8 місяців тому

    cant get it to work...saved file to safe, but how do I call it in my script -credential secretfile...?

  • @SomethingNewToDo
    @SomethingNewToDo 6 років тому +1

    Shane, I tried creating $credentuals = Get-Credential and entered my user ID and password and pressed enter. It came up with the prompt only. Your screen displayed $filename and $credentuals. Why is my screen different?

    • @ShanesCows
      @ShanesCows  6 років тому

      Prompt is correct. I must have done something else.

  • @Gollumfili
    @Gollumfili 2 роки тому

    The 'Connect-MsolService' doesn't seem to work for me. I pass it the credentials and then it brings up a sign in window, asking me to sign into microsoft account. I then sign in with the same credentials and they work. May be it doesn't work for everyone.

  • @frankgoris1338
    @frankgoris1338 5 років тому +1

    Hi Shane,
    Got a question. Does every user loged on a server has free access to the windows credential manager ?
    Or has every user his own set of credentials in de windows credential vault ?

    • @ShanesCows
      @ShanesCows  5 років тому +1

      Each user has his or her own instance of credential manager. Per user.

    • @frankgoris1338
      @frankgoris1338 5 років тому +1

      @@ShanesCows Thank you for you answer ! BTW : I love your powershell videos :-)

  • @krishbroown
    @krishbroown 2 роки тому +1

    Hi Shane, the link to download the powershell is empty :/

    • @ShanesCows
      @ShanesCows  2 роки тому

      Sorry, the site I used no longer is open. :( Sorry.

  • @owentie
    @owentie 3 роки тому +1

    Is there a way to add a "Generic Credential" to all users?

  • @a.useronly2266
    @a.useronly2266 Рік тому +1

    This is so great

    • @ShanesCows
      @ShanesCows  Рік тому

      Happy to help. Have a great day. 🐶

  • @user-zz6fk8bc8u
    @user-zz6fk8bc8u 6 років тому +1

    Just to clear things up. The password is not hashed inside "secretfile.txt" - if it was hashed there would be no way to reverse it (and the software needs a way to reverse it otherwise it couldn't use the password for authentication) - it's encrypted with "the account key" - that means it's very very hard to decrypt it within windows - because the key is inside a file that windows wouldn't let you access. _(With a live system it can be reversed of course)_

    • @ShanesCows
      @ShanesCows  6 років тому

      Thanks. I agree that hash wasn't the perfect word. Thanks for the better, detailed explanation. - Shane

    • @Alexcide007
      @Alexcide007 5 років тому

      The credential store is also not the most secure way to store passwords. I believe there is another way by using certificates, wasn't covered here.

  • @gofftershnit
    @gofftershnit 7 років тому +1

    Get info. However, How would you resolve an error like this is Powershell, when attempting to execute certain commands?The term 'Connect-msolService' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
    At line:1 char:20
    + Connect-msolService

    • @ShanesCows
      @ShanesCows  7 років тому +1

      Hi Robert - That is one of the Office 365 cmdlets. To install it I have a video that will help. ua-cam.com/video/rEy2mlFVWa4/v-deo.html

  • @secretary1653
    @secretary1653 3 роки тому +1

    To find a way to over ride a BIOS password on a Microsoft Surface so that I can format the SSD.

  • @tgrucker
    @tgrucker 7 років тому +2

    Never mind I figured it out, see below.
    $cred = New-Object System.Management.Automation.PSCredential -ArgumentList "$un,$sp"
    Change to
    $cred = New-Object System.Management.Automation.PSCredential -ArgumentList ($un,$sp)
    Not sure why I had to use rounded brackets, but it work.
    Does anyone have a clue why I need the rounded brackets?

  • @AlessandroSqueo
    @AlessandroSqueo 5 років тому +1

    do you have any powershell examples on managing (creating, modifying) GPOs via Powershell?

  • @ianmcpherson2301
    @ianmcpherson2301 7 років тому

    Is there anyway of legally getting copies of your videos for offline viewing. Great reference videos.

    • @ShanesCows
      @ShanesCows  7 років тому +1

      +Ian McPherson never thought about it. 😀 email me and we can figure something out. Shane.Young at BoldZebras com

  • @razadaza9651
    @razadaza9651 4 роки тому +1

    I had to run "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12" in my shell first before I could actually connect to the NuGet repository, prior to that the connection was failing.

    • @ShanesCows
      @ShanesCows  4 роки тому

      Crazy. Glad you got it. 😀

  • @secretary1653
    @secretary1653 3 роки тому +1

    To figure how I can get a Surface Pro that shows its battery as being 255% not to show that %.

  • @rambadey8308
    @rambadey8308 3 роки тому

    Great video Shane ! , I want to automate connecting to Oracle DB through sqlplus and run a sql file, I tried the following way :
    $password = Get-Content "C:\Passwords\password.txt" | ConvertTo-SecureString
    $credential = New-Object System.Management.Automation.PsCredential("username",$password)
    echo exit | sqlplus -S -L username/(Credential.getnetworkCredential()).Password@Database @data.sql > output.txt
    This is not able to connect to DB , If I enter pain text password it works fine.
    This is not really a goodway to hide password. Please help me , how to hide password and get the connection to Oracle DB work .
    I really appreciate your help. Thank you

  • @ITPROFESSIONAL
    @ITPROFESSIONAL 7 років тому +2

    amazing ..thanks alot

  • @meghaAbhiya
    @meghaAbhiya 7 років тому

    Hi Shane, I am learning powershell and I added credential manager credentials to my script, which is automatic, but they will disappear every sunday :( Is there any other way other than this?

    • @ShanesCows
      @ShanesCows  7 років тому

      Hi Megha - What do you mean they disappear?

    • @meghaAbhiya
      @meghaAbhiya 7 років тому

      Whenever the system restarts, the credentials disappear from credential manager

    • @ShanesCows
      @ShanesCows  7 років тому

      This must be a system policy from your administrator or something. That is not a problem I have ever encountered. Sorry.

    • @meghaAbhiya
      @meghaAbhiya 7 років тому

      Yea I searched on google many people have this problem, thank you for your reply though, I will try to find what’s wrong

  • @edu2920
    @edu2920 6 років тому

    Hey
    Can you make a video for passing user name and pwd to "windows Security" popup while access webpage

    • @ShanesCows
      @ShanesCows  6 років тому

      I looked at this briefly yesterday. There seems to be a lot of web searches that cover it. Can you give any examples of things you have tried or what you are trying to accomplish? Happy to help if I can.

  • @AshraRai
    @AshraRai 7 років тому +1

    Very good

  • @hofas2007
    @hofas2007 7 років тому

    hi.. what i do wrong.. when i just do get-storedcredential i recived message "WARNING: Unable to convert Credential object without username or password to PSCredential object" whan i "$cred = get-storedcredentail -target test" $cred is empty... any tip?

    • @hofas2007
      @hofas2007 7 років тому +1

      ok , my foult , i notice there is more then one credentail type in credentail menager..

    • @ShanesCows
      @ShanesCows  7 років тому

      Glad you got it. :)

  • @mrautomation
    @mrautomation 4 роки тому +1

    Great video, thanks for sharing, i also created a video on how to encypt powershell credentials with a certificate. Thats works like a charm as well.

  • @secretary1653
    @secretary1653 3 роки тому +1

    To get 2 Microsoft Surface to see that there is a 128gb SSD in itself. So far it does not see those SSD.

  • @revanonarsi579
    @revanonarsi579 7 років тому

    hi i just came from video 2. where is video 3 for PS? im a bit confused with all these new cmdlets :(

    • @ShanesCows
      @ShanesCows  7 років тому +1

      I don't have a direct video 3. I just have a bunch of other stuff. Tell me what you would like to see in the next video and I will try to help. Always looking for new ideas.

    • @revanonarsi579
      @revanonarsi579 7 років тому +1

      Shane Young just more PS videos for newbies like vid 1 &2. Or other video Directed more for those who want to become MS sys admin (automation)or other roles similar in the industry. I want to be prepared, i love your videos btw. :D

  • @gofftershnit
    @gofftershnit 7 років тому +1

    thanks!

  • @razadaza9651
    @razadaza9651 4 роки тому +1

    hope you don't mind me saying but Nicola Young looks like Elizabeth Holmes in that black top haha

    • @ShanesCows
      @ShanesCows  4 роки тому

      We both found it funny. 🤩

  • @talktome2000
    @talktome2000 7 років тому +1

    Thanks..

    • @ShanesCows
      @ShanesCows  7 років тому

      Looks like you are making your way through all the videos. Glad they are helping. Shane

  • @tgrucker
    @tgrucker 7 років тому

    I've been trying add computers to a domain, using your passwords with powershell. Then I would push with PDQ deploy. I've been testing on a local machine, before I try a push. It's not working.
    Could someone take a look, see below.
    $un = "everest\tr584417"
    $pw = "Password!"
    $sp = "$pw" | ConvertTo-SecureString -AsPlainText -Force
    $cred = New-Object System.Management.Automation.PSCredential -ArgumentList "$un,$sp"
    Add-Computer -DomainName everest.net -OUPath "ou=desktops,ou=rockford,ou=medplans,ou=us,ou=all-computers,ou=firstsource,dc=everest,dc=net" -Credential $cred
    The error message, see below.
    Add-Computer : Value cannot be null.
    Parameter name: s
    At line:1 char:1
    + Add-Computer -DomainName everest.net -OUPath "ou=desktops,ou=rockford,ou=medplan ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Add-Computer], ArgumentNullException
    + FullyQualifiedErrorId : System.ArgumentNullException,Microsoft.PowerShell.Commands.AddComputerCommand
    Now from a local machine I can run this script without any errors, see below.
    Add-Computer -DomainName everest.net -OUPath "ou=desktops,ou=rockford,ou=medplans,ou=us,ou=all-computers,ou=firstsource,dc=everest,dc=net" -cred everest\tr584417 -pass
    Remove-Item move.ps1
    Restart-Computer
    The remove-item, is just for security, so as not to have any files on the machine.

  • @edenmaekelerussom7870
    @edenmaekelerussom7870 3 роки тому +1

    Hey Shane, If I want to ask questions concerning Power Shell is your tweeter adress is Shane Young PowerApps MVP.