Map – Disconnect network drives – TSQL

Configure Map Network Drive using T-SQL

GO
xp_cmdshell "net use Z: \\ServerName\drive$\FolderName <password> /user:domainusername
GO

Disconnect Mapped Network drives

GO
Exec master.dbo.xp_cmdshell 'net use Z: /delete'
GO

Leave a Reply

Your email address will not be published. Required fields are marked *