• Ok, I got it to work but don't really know the explanation. I can explain what I did, but not why it worked. I had to not make the call to the proxy as I wanted to, but Create Credential only. Every example I'd come across showed setting the CREATE CRED in addition to the normal call to sp_xp_cmdshell_proxy_account as it had been doing.

    Any comments, input, enlightening? Again, this was working on other boxes, just not the new box that the network admin setup (security policy won't let me on it).

    /**/

    -----------

    SET @ProxyUser = 'MyDomain\SVC_Acct';

    SET @ProxyPassword = '1Tw034551x78n1n310!';

    IF (ISNULL(@ProxyUser,'')<>'')

    BEGIN

    PRINT '-----Setting proxy account credentials';

    /* Errs right here */

    --EXEC sp_xp_cmdshell_proxy_account @ProxyUser, @ProxyPassword;

    /* DID THIS INSTEAD */

    DECLARE @sqlProxy VARCHAR(255)

    SET @sqlProxy = 'CREATE CREDENTIAL [##xp_cmdshell_proxy_account##] WITH IDENTITY = ''' + @ProxyUser + ''', SECRET = ''' + @ProxyPassword + ''''

    EXEC (@sqlProxy)

    -- Change

    EXECUTE as Login = @ProxyUser;

    END

    SELECT @BackupPath;

    DECLARE @Command nvarchar(100) = 'dir "' + @BackupPath + '"';

    PRINT '----- Shell cmd -----'

    exec xp_cmdshell @Command;

    If (IsNull(@ProxyUser,'')<>'')

    Begin

    PRINT '-----Removing proxy account credentials';

    REVERT

    /* Not THIS */

    --EXEC sp_xp_cmdshell_proxy_account NULL;

    /* But THIS */

    DROP CREDENTIAL [##xp_cmdshell_proxy_account##]

    End

    END