Powershell usage and usage for computer diagnostics

Page 2 of 4 FirstFirst 1234 LastLast

  1. Posts : 1,471
    Win10 Home x64 - 1809
       #11

    I thik this is it. It looks like the title in your sample.
    Yep, that's the output (.txt file) of that script :)

    Was that run on Win7 or Win10 ???

    Note: Most of the time you won't be running scripts that create .txt files on your desktop, but just running a command or two (.i.e. ipconfig /all) and asked to post the result ... So if you don't know how already ... You need to learn how to Copy Text from the PowerShell Window and put it in a post.
    Last edited by Eagle51; 01 Oct 2018 at 01:37.
      My Computers


  2. Posts : 130
    Windows 10
    Thread Starter
       #12

    Was run on Win10 for the printout which I did not examine yet. This Win10 install had been working since
    running the netsh commands I think. I didn't reverse the Blavkbird on it

    What am I looking for in the text?

    Through all this I pulled off the disk showing Caution meaning ready to fail. I think that helped some over on the Win7 install.

    onward.
      My Computer


  3. Posts : 1,471
    Win10 Home x64 - 1809
       #13

    Was run on Win10 for the printout which I did not examine yet. This Win10 install had been working since running the netsh commands I think. I didn't reverse the Blavkbird on it
    Good to hear, glad you got it sorted out.

    What am I looking for in the text?
    Nothing, you can delete the .txt file on your desktop. That particular script is for looking at NetBios stuff, when "NetBios over tcpip" shows Disabled in "ipconfig /all" but shows enabled in the GUI's. It's something I'm working on based on the information I've read so far about that particular issue.
      My Computers


  4. Posts : 1,471
    Win10 Home x64 - 1809
       #14

    FWIW ...
    This is a more useful script and can be used when you want/need to compare Network Settings on two or more PC's ... say one is working and one is not. It's a little advanced and is mainly for me to try and help others having Win10 networking issues.

    Note:
    1. All I've done is take the appropriate MS commands and consolidated them in a script
    2. It's based on information I've learned here on TenForums and the internet for Win10 Networking.

    Code:
    Note: The following script ....
    1. Is for Information ONLY (Makes NO changes to your PC)
    2. Shows your PC NAME (Does NOT reveal any personal info)
    3. It creates a .txt file on your Desktop (Assumes your Desktop Folder has NOT been moved)
    4. Upload the .txt files in your post if you would like help
    
    Open PowerShell as Admin. Copy/Paste the following ... making sure to hit enter after the last line.
    
    $(
    write-output "CHECKING SMB FOR COMPUTER $($env:computername) @ $(get-date -format g)"
    if((Get-WindowsOptionalFeature -Online -FeatureName SMB1Protocol).State -eq "Enabled" -OR (Get-WindowsOptionalFeature -Online -FeatureName SMB1Protocol-Client).State -eq "Enabled" -OR (Get-WindowsOptionalFeature -Online -FeatureName SMB1Protocol-Server).State -eq "Enabled" -OR (Get-WindowsOptionalFeature -Online -FeatureName SMB1Protocol-Deprecation).State -eq "Enabled") {
    write-output "==================="
    write-output "SMB1 FEATURES"
    write-output "==================="
    $scq10 = (sc.exe query mrxsmb10 | FINDSTR "SERVICE_NAME STATE")
    $scqc10 = (sc.exe qc mrxsmb10 | FINDSTR "START_TYPE")
    $scqb = (sc.exe query browser | FINDSTR "SERVICE_NAME STATE")
    $scqcb = (sc.exe qc browser | FINDSTR "START_TYPE")
    get-windowsoptionalfeature -Online -FeatureName SMB1Protocol | FINDSTR "FeatureName"
    get-windowsoptionalfeature -Online -FeatureName SMB1Protocol | FINDSTR "State"
    get-windowsoptionalfeature -Online -FeatureName SMB1Protocol-Client | FINDSTR "FeatureName"
    get-windowsoptionalfeature -Online -FeatureName SMB1Protocol-Client | FINDSTR "State"
    get-windowsoptionalfeature -Online -FeatureName SMB1Protocol-Server | FINDSTR "FeatureName"
    get-windowsoptionalfeature -Online -FeatureName SMB1Protocol-Server | FINDSTR "State"
    get-windowsoptionalfeature -Online -FeatureName SMB1Protocol-Deprecation  | FINDSTR "FeatureName"
    get-windowsoptionalfeature -Online -FeatureName SMB1Protocol-Deprecation | FINDSTR "State"
    write-output " "
    write-output "==================="
    write-output "SMB PROTOCOLS"
    write-output "==================="
    get-smbserverconfiguration | Select EnableSMB1Protocol,EnableSMB2Protocol | FORMAT-LIST
    } else {
    write-output " "
    write-output "==================="
    write-output "SMB PROTOCOLS"
    write-output "==================="
    $scq10 = ""
    $scqc10 = ""
    $scqb = ""
    $scqcb = ""
    write-output "EnableSMB1Protocol : False"
    get-smbserverconfiguration | Select EnableSMB2Protocol | FORMAT-LIST
    }
    write-output " "
    write-output "=================="
    write-output "SERVICES"
    write-output "=================="
    $scq10
    $scqc10
    $scqb
    $scqcb
    sc.exe query mrxsmb20 | FINDSTR "SERVICE_NAME STATE"
    sc.exe qc mrxsmb20 | FINDSTR "START_TYPE"
    sc.exe query fdphost | FINDSTR "SERVICE_NAME STATE"
    sc.exe qc fdphost | FINDSTR "START_TYPE"
    sc.exe query fdrespub | FINDSTR "SERVICE_NAME STATE"
    sc.exe qc fdrespub | FINDSTR "START_TYPE"
    sc.exe query ssdpsrv | FINDSTR "SERVICE_NAME STATE"
    sc.exe qc ssdpsrv | FINDSTR "START_TYPE"
    sc.exe query upnphost | FINDSTR "SERVICE_NAME STATE"
    sc.exe qc upnphost | FINDSTR "START_TYPE"
    sc.exe query dhcp | FINDSTR "SERVICE_NAME STATE"
    sc.exe qc dhcp | FINDSTR "START_TYPE"
    sc.exe query dnscache | FINDSTR "SERVICE_NAME STATE"
    sc.exe qc dnscache | FINDSTR "START_TYPE"
    sc.exe query iphlpsvc | FINDSTR "SERVICE_NAME STATE"
    sc.exe qc iphlpsvc | FINDSTR "START_TYPE"
    sc.exe query lmhosts | FINDSTR "SERVICE_NAME STATE"
    sc.exe qc lmhosts | FINDSTR "START_TYPE"
    sc.exe query lanmanserver | FINDSTR "SERVICE_NAME STATE"
    sc.exe qc lanmanserver | FINDSTR "START_TYPE"
    sc.exe query lanmanworkstation | FINDSTR "SERVICE_NAME STATE"
    sc.exe qc lanmanworkstation | FINDSTR "START_TYPE"
    write-output " "
    write-output "================="
    write-output "SMB REGISTRY KEYS"
    write-output "================="
    if (Get-ItemProperty -Path HKLM:SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters -Name SMB1 -ErrorAction SilentlyContinue) {
    Get-ItemProperty -Path HKLM:SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters -Name SMB1 | FORMAT-LIST -Property SMB1
    } else {
    write-output "NO SMB1 KEY"
    }
    if (Get-ItemProperty -Path HKLM:SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters -Name SMB2 -ErrorAction SilentlyContinue) {
    Get-ItemProperty -Path HKLM:SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters -Name SMB2 | FORMAT-LIST -Property SMB2
    } else {
    write-output "NO SMB2 KEY"
    }
    if (Get-ItemProperty -Path HKLM:SYSTEM\CurrentControlSet\Services\LanmanWorkstation -Name DependOnService -ErrorAction SilentlyContinue) {
    Get-ItemProperty -Path HKLM:SYSTEM\CurrentControlSet\Services\LanmanWorkstation -Name DependOnService | FORMAT-LIST -Property DependOnService
    } else {
    write-output "NO DEPEND ON SERVICE"
    }
    if (Get-ItemProperty -Path HKLM:SYSTEM\CurrentControlSet\Services\Browser\Parameters -Name MaintainServerList -ErrorAction SilentlyContinue) {
    Get-ItemProperty -Path HKLM:SYSTEM\CurrentControlSet\Services\Browser\Parameters | FORMAT-LIST -Property MaintainServerList
    } else {
    write-output "NO BROWSER MAINTAIN SERVER LIST KEY"
    }
    write-output " "
    write-output "========================"
    write-output "LANMAN SERVER PARAMETERS"
    write-output "========================"
    Get-ItemProperty -Path HKLM:SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters
    write-output "============================="
    write-output "LANMAN WORKSTATION PARAMETERS"
    write-output "============================="
    Get-ItemProperty -Path HKLM:SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters
    write-output "================="
    write-output "TCPIP4 PARAMETERS"
    write-output "================="
    Get-ItemProperty -Path HKLM:SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
    write-output "================="
    write-output "TCPIP6 PARAMETERS"
    write-output "================="
    Get-ItemProperty -Path HKLM:SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters
    write-output "========================"
    write-output "SMB CLIENT CONFIGURATION"
    write-output "========================"
    Get-SmbClientConfiguration
    write-output "========================"
    write-output "SMB SERVER CONFIGURATION"
    write-output "========================"
    Get-SmbServerConfiguration
    write-output "==============="
    write-output "IPCONFIG ALL"
    write-output "==============="
    ipconfig /all
    ) > "$($env:userprofile)\Desktop\$env:computername-SMB-CHECK.txt"
    Since you're wanting to learn PowerShell ... here are just the commands. You can Copy/Paste them all at once or line by line into PowerShell and see the output in the PowerShell Window, but either way you'll see why put all these in a script and created a .txt file :)
    Code:
    get-windowsoptionalfeature -Online -FeatureName SMB1Protocol | FINDSTR "FeatureName"
    get-windowsoptionalfeature -Online -FeatureName SMB1Protocol | FINDSTR "State"
    get-windowsoptionalfeature -Online -FeatureName SMB1Protocol-Client | FINDSTR "FeatureName"
    get-windowsoptionalfeature -Online -FeatureName SMB1Protocol-Client | FINDSTR "State"
    get-windowsoptionalfeature -Online -FeatureName SMB1Protocol-Server | FINDSTR "FeatureName"
    get-windowsoptionalfeature -Online -FeatureName SMB1Protocol-Server | FINDSTR "State"
    get-windowsoptionalfeature -Online -FeatureName SMB1Protocol-Deprecation  | FINDSTR "FeatureName"
    get-windowsoptionalfeature -Online -FeatureName SMB1Protocol-Deprecation | FINDSTR "State"
    get-smbserverconfiguration | Select EnableSMB1Protocol,EnableSMB2Protocol | FORMAT-LIST
    sc.exe query mrxsmb10 | FINDSTR "SERVICE_NAME STATE"
    sc.exe qc mrxsmb10 | FINDSTR "START_TYPE"
    sc.exe query browser | FINDSTR "SERVICE_NAME STATE"
    sc.exe qc browser | FINDSTR "START_TYPE"
    sc.exe query mrxsmb20 | FINDSTR "SERVICE_NAME STATE"
    sc.exe qc mrxsmb20 | FINDSTR "START_TYPE"
    sc.exe query fdphost | FINDSTR "SERVICE_NAME STATE"
    sc.exe qc fdphost | FINDSTR "START_TYPE"
    sc.exe query fdrespub | FINDSTR "SERVICE_NAME STATE"
    sc.exe qc fdrespub | FINDSTR "START_TYPE"
    sc.exe query ssdpsrv | FINDSTR "SERVICE_NAME STATE"
    sc.exe qc ssdpsrv | FINDSTR "START_TYPE"
    sc.exe query upnphost | FINDSTR "SERVICE_NAME STATE"
    sc.exe qc upnphost | FINDSTR "START_TYPE"
    sc.exe query dhcp | FINDSTR "SERVICE_NAME STATE"
    sc.exe qc dhcp | FINDSTR "START_TYPE"
    sc.exe query dnscache | FINDSTR "SERVICE_NAME STATE"
    sc.exe qc dnscache | FINDSTR "START_TYPE"
    sc.exe query iphlpsvc | FINDSTR "SERVICE_NAME STATE"
    sc.exe qc iphlpsvc | FINDSTR "START_TYPE"
    sc.exe query lmhosts | FINDSTR "SERVICE_NAME STATE"
    sc.exe qc lmhosts | FINDSTR "START_TYPE"
    sc.exe query lanmanserver | FINDSTR "SERVICE_NAME STATE"
    sc.exe qc lanmanserver | FINDSTR "START_TYPE"
    sc.exe query lanmanworkstation | FINDSTR "SERVICE_NAME STATE"
    sc.exe qc lanmanworkstation | FINDSTR "START_TYPE"
    Get-ItemProperty -Path HKLM:SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters -Name SMB1 | FORMAT-LIST -Property SMB1
    Get-ItemProperty -Path HKLM:SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters -Name SMB2 | FORMAT-LIST -Property SMB2
    Get-ItemProperty -Path HKLM:SYSTEM\CurrentControlSet\Services\LanmanWorkstation -Name DependOnService | FORMAT-LIST -Property DependOnService
    Get-ItemProperty -Path HKLM:SYSTEM\CurrentControlSet\Services\Browser\Parameters | FORMAT-LIST -Property MaintainServerList
    Get-ItemProperty -Path HKLM:SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters
    Get-ItemProperty -Path HKLM:SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters
    Get-ItemProperty -Path HKLM:SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
    Get-ItemProperty -Path HKLM:SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters
    Get-SmbClientConfiguration
    Get-SmbServerConfiguration
    ipconfig /all
    Last edited by Eagle51; 15 Oct 2018 at 18:15.
      My Computers


  5. Posts : 130
    Windows 10
    Thread Starter
       #15

    I'll give it whirl. There are bound to be other questions I have about using Powershell. So will keep the thread open.
      My Computer


  6. Posts : 130
    Windows 10
    Thread Starter
       #16

    This started with a discussion of the Blackbird security application program for Win10.
    Since my last visit here I have gotten the application installed and have had instruction on how
    to reactivate just one of the switches for LAN usage.

    Now the Win10 source PC 'dials out' ok and sees data on a target network PC.

    I'm now looking at a reverse problem. The target PC shows the Win10 PC alright but
    I'm getting the error again when attempting to open using the the target back
    to the source.

    How can one of these scripts help with that? I've also inquired at a Blackbird
    discussion if there are other switches needed besides the LAN one I was given.

    Barring that I may have to just do a reinstall with all this new info and procedures and
    give them some sort of order to avoid botches.
      My Computer


  7. Posts : 6,849
    22H2 64 Bit Pro
       #17

    Check what you see here:

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Security Center]"cval"=dword:00000000

    If set to 1 - try 0 instead and reboot to test.

    RE: Blackbird. There is also a way to restore windows defaults. (Run restore backup and you should see the option)

    On my machine I no longer need Blackbird. I created a new profile with admin rights and used software to copy existing parts of the old blackbird modified profile into the new one. Then deleted the old profile. I now have Windows 10 without Windows Store, Store Apps, Cortana, Edge. No problem. That's how I like it.

    Problem. I was lucky and cannot remember the exact steps taken.
      My Computer


  8. Posts : 130
    Windows 10
    Thread Starter
       #18

    Ok I'll look at the reg entry. Is that on the Win10 which is now finding target nodes ok or the target PC?
    I'll check both.

    Did you turn off updates in your modified version? Or is that left to modify in Services? I did that
    and also learned about the 'retries' and how to turn that off.
      My Computer


  9. Posts : 6,849
    22H2 64 Bit Pro
       #19

    It's on the Blackbird modified PC only. RE: Windows Updates. They were already disabled via WUMT Wrapper Script.

    Stop Windows 10 Updates Properly and Completely Solved - Page 8 - Windows 10 Forums
      My Computer


  10. Posts : 130
    Windows 10
    Thread Starter
       #20

    That update thread is a long one. And I haven't even gotten a Powershell book to look at yet.
    Levels on levels of complication. What seems to emerge from all this is taking away the sovereinty of the
    user as policy-- all the redundancies and alternatives for the OS to accomplish what it wants to.
    It's like attending Def Con, or how I can view those on youtube.

    I see that what is needed is a routine that begins with a scratch install. For this project I do the
    scratch install with no ethernet conneted. And don't plug in until after I've
    done operations to turn off updates and, in this instance, run Blackbird.

    You mention Major Geeks and I know they have and I have used a large suite of programs for virum protection written in a procedural way. Let me ask it this way: Is there a step by step method anyone uses or can suggest to follow in rote manner which is all I can really do?

    I'll get the WUMT from Major Geeks to a thumb drive which is where I'm storing all these things.

    As has been mentioned, Blackbird may not be a good method for me. So perhaps TenForms can suggest
    something better and built up for a sticky as reference.

    I
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 10:54.
Find Us




Windows 10 Forums