PoshSec¶
Welcome to the help and documentation for the PoshSec PowerShell Module.
Current Version: 2.0
List of available commands¶
This is the current list of available commands in PoshSec.
Get-DomainAdmins¶
Synopsis¶
Obtains the list of Domain Admins
Description¶
Obtains the list of domain admins for the current or specified domain.
Parameter¶
Name: Domain
Description: This is the Active Directory name to pull the Domain Admins list from.
Examples¶
PS> Get-DomainAdmins
DisplayName SamAccountName DistinguishedName
---------- ------------- -----------------'
TestAccount TestAccount cn=TestAccount,OU=PoshSec,DC=PoshSec,DC=Com
Bob Uncle Bob.Uncle cn=Bob Uncle,OU=PoshSec,DC=PoshSec,DC=Com
PS> Get-DomainAdmins -Domain 'poshsec.com'
DisplayName SamAccountName DistinguishedName
---------- ------------- -----------------'
TestAccount TestAccount cn=TestAccount,OU=PoshSec,DC=PoshSec,DC=Com
Bob Uncle Bob.Uncle cn=Bob Uncle,OU=PoshSec,DC=PoshSec,DC=Com
Notes¶
Part of the PoshSec PowerShell Module
Get-EnterpriseAdmins¶
Synopsis¶
Obtains the list of Enterprise Admins
Description¶
Obtains the list of Enterprise admins for the current or specified domain.
Parameter¶
Name: Domain
Description: This is the Active Directory name to pull the Enterprise Admins list from.
Examples¶
PS> Get-EnterpriseAdmins
DisplayName SamAccountName DistinguishedName
---------- ------------- -----------------'
TestAccount TestAccount cn=TestAccount,OU=PoshSec,DC=PoshSec,DC=Com
Bob Uncle Bob.Uncle cn=Bob Uncle,OU=PoshSec,DC=PoshSec,DC=Com
PS> Get-EnterpriseAdmins
DisplayName SamAccountName DistinguishedName
---------- ------------- -----------------'
TestAccount TestAccount cn=TestAccount,OU=PoshSec,DC=PoshSec,DC=Com
Bob Uncle Bob.Uncle cn=Bob Uncle,OU=PoshSec,DC=PoshSec,DC=Com
Notes¶
Part of the PoshSec PowerShell Module.
Get-AccountsThatDontExpire¶
Synopsis¶
Gets a list of the accounts that don’t expire.
Description¶
Gets a list of the accounts from the active directory domain that don’t expire.
Examples¶
PS> Get-AccountThatDontExpire
DisplayName SamAccountName DistinguishedName
---------- ------------- -----------------'
TestAccount TestAccount cn=TestAccount,OU=PoshSec,DC=PoshSec,DC=Com
Bob Uncle Bob.Uncle cn=Bob Uncle,OU=PoshSec,DC=PoshSec,DC=Com
Notes¶
Part of the PoshSec PowerShell Module
Get-AccountsThatExpire¶
Synopsis¶
Gets a list of the accounts that expire.
Description¶
Gets a list of the accounts from the active directory domain that expire.
Examples¶
PS> Get-AccountThatExpire
DisplayName SamAccountName DistinguishedName
---------- ------------- -----------------'
TestAccount TestAccount cn=TestAccount,OU=PoshSec,DC=PoshSec,DC=Com
Bob Uncle Bob.Uncle cn=Bob Uncle,OU=PoshSec,DC=PoshSec,DC=Com
Notes¶
Part of the PoshSec PowerShell Module
Get-Administrators¶
Synopsis¶
Obtains the list of Domain Admins
Description¶
Obtains the list of domain admins for the current or specified domain.
Parameter¶
Name: Domain
Description: This is the Active Directory name to pull the Domain Admins list from.
Examples¶
PS> Get-Administrators
DisplayName SamAccountName DistinguishedName
---------- ------------- -----------------'
TestAccount TestAccount cn=TestAccount,OU=PoshSec,DC=PoshSec,DC=Com
Bob Uncle Bob.Uncle cn=Bob Uncle,OU=PoshSec,DC=PoshSec,DC=Com
PS> Get-Administrators -Domain 'poshsec.com'
DisplayName SamAccountName DistinguishedName
---------- ------------- -----------------'
TestAccount TestAccount cn=TestAccount,OU=PoshSec,DC=PoshSec,DC=Com
Bob Uncle Bob.Uncle cn=Bob Uncle,OU=PoshSec,DC=PoshSec,DC=Com
Notes¶
Part of the PoshSec PowerShell Module
Convert-FQDNtoDN¶
Synopsis¶
Converts FQDN to FQDN
Description¶
This converts a user supplied Fully Qualified DOmain Name (FQDN) into a Distinguished Name (DN).
Parameter¶
Name: domainFQDN
Description: This is the Fully Qualified Domain Name (FQDN) that needs to be turned into a Distinguished Name (DN).
Example¶
PS> Convert-FQDNtoDN -domainFQDN 'poshsec.com'
DC=poshsec,DC=com
PS> Convert-FQDNtoDN 'dev.contoso.net'
DC=dev,DC=contoso,DC=NET
Notes¶
This is a PoshSec Utility Function
Confirm-IsAdministrator¶
Sysnopsis¶
Checks to see if user is running as administrator
Description¶
This function checks to see if the user is currently running as an administrator
Example¶
PS> Confirm-IsAdministrator
False
PS> if (Confirm-IsAdministrator) { Write-Host "You are an admin" }
You are an admin
Notes¶
Part of the PoshSec PowerShell Module.
License¶
BSD 3-Clause License
Copyright (c) 2017, PoshSec All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Help¶
- To obtain help with PoshSec, do one of the following
- File an issue on Github <https://github.com/PoshSec/PoshSec>
- Tweet at @PoshSec
- Email team@poshsec.com