Skip to content

Commit

Permalink
added enable_os_share_windows.ps1 script to windows ci
Browse files Browse the repository at this point in the history
  • Loading branch information
telamonian committed Apr 7, 2020
1 parent a6dc353 commit 6117ab9
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
11 changes: 9 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,17 @@ parameters:
- task: PowerShell@2
inputs:
targetType: 'filePath'
filePath: 'ci/start_smb_os_windows.ps1'
filePath: 'ci/enable_os_share_windows.ps1'
errorActionPreference: 'stop'
failOnStderr: True
displayName: 'Expose share on os builtin samba server'
displayName: 'Enable os builtin file sharing'
- task: PowerShell@2
inputs:
targetType: 'filePath'
filePath: 'ci/create_os_share_windows.ps1'
errorActionPreference: 'stop'
failOnStderr: True
displayName: 'Create share on os builtin samba server'

- name: testSteps
type: stepList
Expand Down
File renamed without changes.
15 changes: 15 additions & 0 deletions ci/enable_os_share_windows.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#Requires -RunAsAdministrator

$ErrorActionPreference = 'Stop'

# script to overcome all weird windows vm settings on azure

# disable all password requirements (length, complexity, etc)
# needed to allow for creation of new account smbuser:smbuser
secedit /export /cfg c:\secpol.cfg
(gc C:\secpol.cfg).replace("PasswordComplexity = 1", "PasswordComplexity = 0") | Out-File C:\secpol.cfg
secedit /configure /db c:\windows\security\local.sdb /cfg c:\secpol.cfg /areas SECURITYPOLICY
rm -force c:\secpol.cfg -confirm:$false

# turn on file sharing
netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=Yes
File renamed without changes.

0 comments on commit 6117ab9

Please sign in to comment.