Skip to content

Using pywinrm unable to mount samba share using command "net use" #390

@MohitBis

Description

@MohitBis

I have running below command using pywinrm
cmd = f'cmd /c net use {drive}: \\{smb_server}\{share} {smb_user_password} /user:.{smb_user_name}'
result = self.session.run_cmd(cmd)

Output is "The Command completed successfully"

But when i am using the share detail it is showing Unavailable

net use

New connections will be remembered.

Status Local Remote Network


Unavailable M: \10.0.67.250\share1 Microsoft Windows Network
The command completed successfully.

Same mount command working as expected when running manually

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions