Microsoft

RootCtl.com



Windows
 

DNS
 

Account Lockouts in Active Directo



 

Windows Sandbox
 

Group Policy
 

DC Replication
 
My KB






 

Get
------------------GET and Examples------------------------
Get-Command -Name *Get-IIS*
Get-Command -Name *IP*
Get-Help - update help PowerShell
Get-Help Get-NetAdapter -examples
Get-NetIPAddress | Out-GridView
Get-NetIPConfiguration | Get-NetIPAddress
Get-History | Out-GridView
Get-Service | Out-GridView
Get-Process | Out-GridView
Get-Acl C:\temp | Out-GridView
Get-Service MSMQ
Get-WindowsFeature | Where-Object {$_. installstate -eq "installed"} | Format-List Name,Installstate | more
Get-Help Get-Command
Get-Service -Name win* | Format-Table -AutoSize
Get-Service | Export-csv services.csv
Get-Process | Format-List | Out-Host -Paging
Get-Process | ConvertTo-Html | Out-File -FilePath PSDrives.html
Get-Process | Export-Clixml | Out-File -FilePath PSDrives.xml
Get-Process winlogon | Format-List -Property *
Get-ScheduledTask
Get-Alias cd, dir, ls, man

Get-Help -Name Get-Service
Get-Service | Select -First 10 | Write-Host
Get-Service | Select -First 10 | Write-Output
Get-Service | Where-Object {$_.Status -eq 'Running'}
#############################
Get-Service | Where-Object {$_.Starttype -eq "Auto"}
##########################################################
Get-Service | Where-Object {$_.Starttype -eq "Auto" -and $_.state -ne 'Stopped'}
####################################################################
Get-Service | select -property name,starttype
Get-Service | Where-Object {$_.Status -EQ "Running"}
Set-Service [service name] -startuptype automatic

Get-Command -Verb Export | Select-Object CommandType, Name, Version, Source | Out-File C:\ExportCommands.txt
Get-Command -Verb Export | Select-Object CommandType, Name, Version, Source | Out-File C:\ExportCommands.txt -Append
Get-Command -Verb Export | Select-Object CommandType, Name, Version, Source | Export-Csv -NoTypeInformation -Path C:\NewFolder\ExportCommands.CSV
Get-Process | ForEach-Object ProcessName

 

Active Directory

 

Azure
 
PowerShell Networking Connection:
 
GPO
 

Exchange
  • ExchangeMaintenance


  • Get-Service | Where-Object { $_.DisplayName -like "Microsoft Exchange *" } | ft Name,Status

    in order to disable all Exchange Server Services, run following command :
    Get-Service | Where-Object { $_.DisplayName –like “Microsoft Exchange *” } | Set-Service –StartupType Disable

    Stopping Exchange Services:
    Get-Service | Where-Object { $_.DisplayName –like “Microsoft Exchange *” } | Stop-Service

    Enabling Exchange Services:
    Get-Service | Where-Object { $_.DisplayName –like “Microsoft Exchange *” } | Set-Service –StartupType Automatic

    Starting Exchange Services:
    Get-Service | Where-Object { $_.DisplayName –like “Microsoft Exchange *” } | Start-Service



     
    Event like Reboot OR Shutdown  
    VMWARE:

    ovftool --noSSLVerify "vi://root@esx.hostname.lan/abcd" C:\Temp\abcd.ova
    Vmware tools : install -y open-vm-tools

    NFS Multipathing VMware vSphere 6.7
    ----------------------------------------------------
    While NFS 3 with ESXi does not provide multipathing support, NFS 4.1 supports multiple paths.
    NFS 3 uses one TCP connection for I/O. As a result, ESXi supports I/O on only one IP address or hostname for the NFS server, and does not support multiple paths.
    Depending on your network infrastructure and configuration, you can use the network stack to configure multiple connections to the storage targets. In this case,
    you must have multiple datastores, each datastore using separate network connections between the host and the storage.
    NFS 4.1 provides multipathing for servers that support the session trunking. When the trunking is available, you can use multiple IP addresses to access a single NFS volume.
    Client ID trunking is not supported.

     
    WMIC

     

    NTFS Permission
    1- NTFS Permission are cumulative.
    2- File Permission override folder permission
    3- Deny override other permission
    More Details below :
    o NTFS permissions are available only on NTFS volumes and are used to specify which users and groups can access files and folders and what these users can do with the contents of those files or folders.
    o NTFS folder permissions are Read, Write, List Folder Contents, Read & Execute, Modify, and Full Control.
    o The NTFS file permissions are Read, Write, Read & Execute, Modify, and Full Control.
    o Administrators, the owners of files or folders, and users with Full Control permission can assign NTFS permissions to users and groups to control access to files and folders.
    o NTFS stores an ACL, which contains a list of all user accounts and groups that have been granted access to the file or folder, as well as the type of access that they have been granted,
    with every file and folder on an NTFS volume.
    o A user attempting to gain access to a resource must have permission for the type of access that is requested to gain access.
    o You can assign multiple permissions to a user account by assigning permissions to his or her individual user account and to each group of which the user is a member.
    o NTFS file permissions take priority over NTFS folder permissions.
    o A user's effective permissions for a resource are based on the NTFS permissions that you assign to the individual user account and to all of the groups to which the user belongs.
     

    More
    <

    box



    Get-TimeZone -ListAvailable
    Set-TimeZone "Eastern Standard Time"











     

    X
    2. Determine the Windows uptime status
    uptime

    3. Synchronize the date and time
    net time /SET

    4. Obtain a list of installed software
    Get-WmiObject -Class Win32_Product

    5. List of Microsoft updates installed
    Get-HotFix

    6. Generate a list of all users
    wmic userAccount get Name

    7. Determine the amount of data storage used
    wmic logicaldisk get size,freespace,caption

    dir /s “DirectoryName”
     

    Fix Windows 10 Problems Easily
    System File Checker : sfc /scannow
    OS Image Repair : dism.exe /online /cleanup-image /restorehealth
    Check Disk : chkdsk /x /f /r









    Azur




    C

    P
    1. T
    2. End
    3. DDONE