Windows PowerShell Best Practices by Ed Wilson
Author:Ed Wilson [Ed Wilson]
Language: eng
Format: epub, pdf
Tags: COMPUTERS / System Administration / General
ISBN: 9780735666481
Publisher: Microsoft Press
Published: 2014-01-13T16:00:00+00:00
Note
Keep in mind that you want to convert the contents of the passwordHash.txt file to a secure string and not the path to the passwordHash.txt file. The first time I attempted this operation, I used the following command: ConvertTo-SecureString C:\fso-\-passwordHash.txt, which does not work. I then realized that I was trying to encrypt the path to the file and not the contents of the file.
A more efficient way to create the password hash text file is to use pipelining and thus avoid the intermediate variable as shown here. When the command is run, it prompts for the password.
PS C:\> Read-Host -Prompt "Enter your password" -AsSecureString | >> ConvertFrom-SecureString >> C:\fso\passwordHash.txt
To use this password hash text file in a script, you can use a script like the one shown here.
Example 11-26. UsePasswordHashFile.ps1
$user = "Nwtraders\administrator" $password = ConvertTo-SecureString -String (Get-content C:\fso\passwordHash.txt) $credential = new-object system.management.automation.PSCredential $user,$password Get-WmiObject -class Win32_Bios -computername berlin -credential $credential
Download
Windows PowerShell Best Practices by Ed Wilson.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Implementing Enterprise Observability for Success by Manisha Agrawal and Karun Krishnannair(7321)
Supercharging Productivity with Trello by Brittany Joiner(6583)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6413)
Mastering Tableau 2023 - Fourth Edition by Marleen Meier(6340)
Inkscape by Example by István Szép(6200)
Visualize Complex Processes with Microsoft Visio by David J Parker & Šenaj Lelić(5899)
Build Stunning Real-time VFX with Unreal Engine 5 by Hrishikesh Andurlekar(4892)
Design Made Easy with Inkscape by Christopher Rogers(4589)
Customizing Microsoft Teams by Gopi Kondameda(4129)
Linux Device Driver Development Cookbook by Rodolfo Giometti(3933)
Extending Microsoft Power Apps with Power Apps Component Framework by Danish Naglekar(3718)
Business Intelligence Career Master Plan by Eduardo Chavez & Danny Moncada(3674)
Salesforce Platform Enterprise Architecture - Fourth Edition by Andrew Fawcett(3593)
Pandas Cookbook by Theodore Petrou(3574)
The Tableau Workshop by Sumit Gupta Sylvester Pinto Shweta Sankhe-Savale JC Gillet and Kenneth Michael Cherven(3375)
TCP IP by Todd Lammle(2982)
Drawing Shortcuts: Developing Quick Drawing Skills Using Today's Technology by Leggitt Jim(2910)
Applied Predictive Modeling by Max Kuhn & Kjell Johnson(2858)
Work Smarter with Microsoft OneNote by Connie Clark(2842)
