Powershell - SID to USER and USER to SID
2013-05-07 10:30
309 查看
I recently needed to quickly find a user associated to a SID, and thought these were handy so wanted to share
I used the PowerShell Module for AD
*Added the LOCAL USER*
I used the PowerShell Module for AD
1. | Domain User to SIDThis will give you a Domain User's SID$objUser = New-Object System.Security.Principal.NTAccount("DOMAIN_NAME", "USER_NAME") $strSID = $objUser.Translate([System.Security.Principal.SecurityIdentifier]) $strSID.Value | |
---|---|---|
2. | SID to Domain UserThis will allow you to enter a SID and find the Domain User$objSID = New-Object System.Security.Principal.SecurityIdentifier ` ("ENTER-SID-HERE") $objUser = $objSID.Translate( [System.Security.Principal.NTAccount]) $objUser.Value | |
3. | LOCAL USER to SID$objUser = New-Object System.Security.Principal.NTAccount("LOCAL_USER_NAME")$strSID = $objUser.Translate([System.Security.Principal.SecurityIdentifier]) $strSID.Value |
Conclusion
Hope this isn't a re-post!*Added the LOCAL USER*
相关文章推荐
- SharePoint2013 Powershell script to get site Title, Site Owner, Site user count and usage
- 使用 Office 365 PowerShell 管理用户帐户和许可证(五)Assign roles to user accounts with Office 365 PowerShell
- The Essential Guide to User Interface Design: An Introduction to GUI Design Principles and Technique
- Disable to auto complete fill in user name and password
- [转]POI : How to Create and Use User Defined Functions
- The servlets named [UserExit] and [com.fxh.control.UserExit] are both mapped to the url-pattern [/Us
- create sqlserver login user and add it to certain db user (sqlserver authentication)
- How to share memory between services and user processes?
- How to Add a User and Grant Root Privileges on CentOS 6.5
- User Xcode and GCC How to create a C programe
- Allow user to scroll and maintain position with "Scroll To Bottom of the Div" example
- copy_from_user | copy_to_user and so on
- Display Locks and Gives the SID and Serial Number of the session to kill
- Android LruCache : how to put and get user's data
- How to create a new user and grant permissions on MySql
- 9 Tips to Use Apachectl and Httpd like a Power User
- How To Do Math Using PowerShell, Part 1 and Part 2
- How to provide username and password when run "git clone git@remote.git"? - Stack Overflow
- SarePoint Powershell Add user to Group
- WinForms Controls > Examples > How to: Add New XtraForm, RibbonForm and XtraUserControl to Your Proj