one logs into sql server using shared memory it returns null value for the tcpip port. This also used xp_cmdshell so enable it if it's not and disable it after the script executed SETSPN –S ...