After performing Ansible playbook with task responsible for mapping network drive (I didn't use the win_mapped_drive module, used powershell commands) with a result Successful , mapped drive is not visible after RDP to the PC client where it was performed.
Ansibleplaybook task below.Varsare defined in a client specific.ymlfile and were substituted correctly.
-
name: Step 9 Map a network drive with new credentials - tag share_mod
win_shell: $driveLetter = "T" ; $networkPath = "{{ fs_path }}" ; $username = "{{ fs_acc }}" ; $securePassword = ConvertTo-SecureString -String "{{ fs_acc_pwd }}" -AsPlainText -Force ; $credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $username, $securePassword ; New-PSDrive -Name $driveLetter -PSProvider "FileSystem" -Root $networkPath -Credential $credential -Persist
tags:
- share_add
After RDP to this PC Client, there is no mapped drive with a letter
TVie from File ExplrerOutput from
Powershellnon-admin powershell non-adminOutput from
Powershellas admin powershell admin There theLocal Path Z:is displayed because of the drive mapped manually on the same PC Client but on a different user profile.