Get-WindowsFeature FS-SMB1
Disable-WindowsOptionalFeature -Online -FeatureName smb1protocol
Enable-WindowsOptionalFeature -Online -FeatureName smb1protocol
Get-SmbServerConfiguration | Select EnableSMB2Protocol
Set-SmbServerConfiguration -EnableSMB2Protocol $false
Set-SmbServerConfiguration -EnableSMB2Protocol $true
Last active
April 9, 2019 20:21
-
-
Save sdaaish/6bd3b839864c52e4e35abe963144c428 to your computer and use it in GitHub Desktop.
Powershell SMB examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
System | Ip | Type | Other | |
---|---|---|---|---|
dev.idg.se | 1.1.1.1 | Ubuntu | Development | |
hr.dn.se | 2.2.2.2 | Debian | Human Resources | |
www.gp.se | 3.3.3.3 | FreeBsd | Front web site |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$csv = import-csv 2.csv | |
$csv|Add-Member -NotePropertyName ShortHost -NotePropertyValue '' | |
$collection = @() | |
foreach($i in $csv){ | |
$i.shorthost = ($i.system).split(".")[0] | |
$collection += $i | |
} | |
$collection|select-object System,ShortHost,Ip,Type,Other | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment