sc query is your friend

phoeneousphoeneous Member Posts: 2,333 ■■■■■■■□□□
I've always used this command, just wanted to share it with those who arent too familiar with it. If you want to check the state of or start/stop the firewall of a remote host, use sc \\target {start, stop, query} sharedaccess. Very useful for troubleshooting. You can test this on a local host by omitting the \\target.


  • Options
    RobertKaucherRobertKaucher Member Posts: 4,299 ■■■■■■■■■■
    Yes, this is up there with netsh int ip reset and netsh winsock reset IMO. Although it is not cert related the PSKILL [URL="file://\\target"]\\target[/URL] to kill a remote process is really nice for those who support buggy 3rd part aps that always hang on someone's PC.
  • Options
    gatewaygateway Member Posts: 232
    I like posts like this :)
    I agree Robert, PSTools are great - I use psexec all the time mainly for opening command prompts on remote machines.

    Again not quite cert related but:
    wuauclt /detectnow - force windows to check for new updates
    dsquery computer -inactive 24 -limit 0 - Checks AD for old computer accounts (24 weeks of inactivity in this case)
    wmic MEMORYCHIP get banklabel, devicelocator, caption, capacity - wmi query for installed ram - together with its many other other uses.

    I use the below quite a bit to obtain serial number/part numbers of machines too.
    wmic /node:"%target%" bios get serialnumber
    wmic /node:"%target%" baseboard get product
    wmic /node:"%target%" computersystem get model

    One of my favourite tools is subinacl. Command line tool to redrill any permissions you want through files/folders. Handy when you have hundreds of gb's of data, you dont want to amend ANY existing permissions on the hundreds of acl's you currently have in place, but simply add one entry to everything etc. Powerful tool.
    Blogging my AWS studies here! http://www.itstudynotes.uk/aws-csa
Sign In or Register to comment.