Difference between revisions of "General Powershell Notes"

From Michael's Information Zone
Jump to navigation Jump to search
Line 6: Line 6:
 
Get-NTFSAccess -path .\Contacts
 
Get-NTFSAccess -path .\Contacts
 
add-ntfsaccess -path .\contacts -account first.last -accessrights read
 
add-ntfsaccess -path .\contacts -account first.last -accessrights read
 +
</pre>
 +
==Passing Passwords to PSSession==
 +
<ref>http://web.archive.org/web/20160822030847/http://geekswithblogs.net/Lance/archive/2007/02/16/106518.aspx</ref> Convert to secure string then call from file. This following pulls from stdin as a secure string (converts what you type), then converts that to something (I'm still new to Microsoft's ways of doing things), then stores as a file.
 +
<pre>
 +
read-host -assecurestring | convertfrom-securestring | out-file C:\securestring.txt
 
</pre>
 
</pre>

Revision as of 14:30, 23 May 2017

[1]

NTFS Permissions

[2] [3]

Get-NTFSAccess -path .\Contacts
add-ntfsaccess -path .\contacts -account first.last -accessrights read

Passing Passwords to PSSession

[4] Convert to secure string then call from file. This following pulls from stdin as a secure string (converts what you type), then converts that to something (I'm still new to Microsoft's ways of doing things), then stores as a file.

read-host -assecurestring | convertfrom-securestring | out-file C:\securestring.txt