I thought about a workaround, since there seems to not be any permanent solution from a GPO level, how about I run a startup script for all users. It would need to check the CSC\namespace folder for the existence of 10.0.0.66, take ownership of the folder and delete it. That way, once the boot sequence is completed and the Sync Center starts, that Sync Partnership is already deleted.
To avoid any time-consuming processes that could delay the boot up, I would need it to check if CSC\v2.0.6\namespace\10.0.0.66 exists, and if it does, to take ownership of it as Administrator and then delete it.
I imagine it will first check the echo of the CMD dir command, and then if 10.0.0.66 exist, goto take ownership, and when the ownership is done, then delete and exit.
I am not even sure how to check the echo of a command like dir, anyone who could give me any suggestions?
I am thinking it would have to be something like this:
::::::::::::::::::::::::::::::::::::::::::::
:: Automatically check & get admin rights
::::::::::::::::::::::::::::::::::::::::::::
@echo off
CLS
ECHO.
ECHO ===============================
ECHO Running Admin Command Prompt
ECHO ===============================
:init
setlocal DisableDelayedExpansion
set "batchPath=%~0"
for %%k in (%0) do set batchName=%%~nk
set "vbsGetPrivileges=%temp%\OEgetPriv_%batchName%.vbs"
setlocal EnableDelayedExpansion
:checkPrivileges
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges )
:getPrivileges
if '%1'=='ELEV' (echo ELEV & shift /1 & goto gotPrivileges)
ECHO.
ECHO **************************************
ECHO Invoking UAC for Privilege Escalation
ECHO **************************************
ECHO Set UAC = CreateObject^("Shell.Application"^) > "%vbsGetPrivileges%"
ECHO args = "ELEV " >> "%vbsGetPrivileges%"
ECHO For Each strArg in WScript.Arguments >> "%vbsGetPrivileges%"
ECHO args = args ^& strArg ^& " " >> "%vbsGetPrivileges%"
ECHO Next >> "%vbsGetPrivileges%"
ECHO UAC.ShellExecute "!batchPath!", args, "", "runas", 1 >> "%vbsGetPrivileges%"
"%SystemRoot%\System32\WScript.exe" "%vbsGetPrivileges%" %*
exit /B
:gotPrivileges
setlocal & pushd .
cd /d %~dp0
if '%1'=='ELEV' (del "%vbsGetPrivileges%" 1>nul 2>nul & shift /1)
::::::::::::::::::::::::::::
::START
::::::::::::::::::::::::::::
:start
cd C:\Windows\CSC\v2.0.6\namespace
dir
if '%1' == 'dir' ( echo 10.0.0.66 /1 & goto takeOwnership ) else ( goto Exit )
:takeOwnership
takeown /f C:\Windows\CSC\v2.0.6\namespece\10.0.0.66\* /R /A
::::::::::::::::::::::::::::::
::Incomplete step
::::::::::::::::::::::::::::::
if '%1' == 'takeown' ( echo ::missing text:: goto delPartnership ) else ( goto Start )
:delPartnership
del C:\Wndows\CSC\v2.0.6\namespace\10.0.0.66 /y
cd C:\Windows\CSC\v2.0.6\namespace
dir
if '%1' == 'dir' ( echo 10.0.0.66 /1 & goto Start ) else ( goto Exit )
:Exit
exit
Can anyone check if I am correct?