Cmdlet ????? ??????????????????? ?? ????? ????? ????? ???? ???????????????? ??? ?????

?????? ????????? ?????? ?????????
???? ???????: 2935813 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

???????

???? ??? ????????? ??????:
  • ????? ??????? ????? ??????????????????? Cmdlet PowerShell ???? ?? ?????? ?? ??????? ???????? 1 Microsoft System Center 2012 ????? ????? Service Pack 1 (SP1) ????? ???? ????? ???? ????? (DP).
  • ??? ??????? ??? ????? ??? ?????? ?? ?? ?????? ??? ????? ??? ??????? ????? ?? ??? ?????? ?????? DP ?????.
?? ??? ?????????? ??? ?? ????? ?????? ?????? ??????? ?? ?????? ????? ?????? ?? ??????? ?????? (CAS ?? ????? ?????). ??? ??? ?????? ????? ?? ??????? ?????? ????? ?????? ???? ??? DP ???? ?????? ???????? ?????? ????? ????? ???????. ???? ??? ??? ??????? DataTransferService.log ??? ??????.

?????

???? ??? ???? cmdlet PowerShell ??????????????????? ????? ??? ??? ?????? ?????? ??????? (FQDN) ??? ???? ????? ?????????????????????S????? ????? ?????? ????? ?? ??????? ??????. ????? ?????? ?????? ?????? ???? ????? ???? ?????? ??????? ???. ???? ??? ?????? ???????? ??? ??????? ?????? (??? ?????? ??????? IP ??? ???? "Active Directory"? ?????) ?????? ???? ?? ?????? FQDN ???? ??????? ?? ??????????.

????

??? ??? ???????? ?? ?????? "???? forSystem 3 ??????? ????????" 2012 ????? ????? Service Pack 1 (SP1).????? ?? ????????? ??? ??? ??????? ????????? ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ? Microsoft":
2882125 ??? ??????? ???????? 3 ? System Center 2012 ????? ????? Service Pack 1

???? ??????

????? ?? ??????? ?? ???? ????? ???????????????????S ??????????. ???? ?????? ?? ????? VBScript ?????? ?????? ??? ??????? ??? ?????? ???????? ????? ?? ????:

'Sample script to connect to the SMS provider for a specific site server (argument 1)
' for a specific site code (argument 2) and
' and correct ServerRemoteName for a specified DP (argument 3) in a specified site (argument 4) if it does not match ServerName.

On Error Resume Next

'Validate command line arguments

Set args=wscript.arguments

If args.Count = 4 then
strProviderSiteServer = WScript.Arguments(0)
strProvSiteCode = UCASE(WScript.Arguments(1))
strDPServer = WScript.Arguments(2)
strDPSiteCode = UCASE(WScript.Arguments(3))
Else
wscript.Echo "Incorrect command line arguments." & vbCrLf
wscript.Echo "Usage: cscript //nologo CorrectServerRemoteName.VBS <ProviderServer> <ProvSiteCode> <DPServer> <DPSiteCode>" & vbCrLf
wscript.Echo "Example: cscript //nologo CorrectServerRemoteName.VBS Server01 CAS DPServer PRI" & vbCrLf
WScript.Quit(1)
End If

'Connect to the provider on the specified site server

strProviderSiteServer = "\\" + strProviderSiteServer + "\"
Set ObjSDKConn = GetObject("winmgmts:" & "{impersonationLevel=Impersonate,authenticationLevel=Pkt}!" & strProviderSiteServer & "root\sms\site_" & strProvSiteCode)

If Err.number <> 0 then
wscript.Echo "Connecting to the provider failed with code: " & Err.number
WScript.Quit(2)
End If

'Query for the specified DP

strQuery = "Select * from SMS_SCI_SysResUse where RoleName='SMS Distribution Point' and SiteCode='" & strDPSiteCode & "' and NetworkOSPath like '%" & strDPServer & "%'"
Set ObjQueryResult = ObjSDKConn.ExecQuery(strQuery)

If Err.number <> 0 then
wscript.Echo "Querying for the specified DP server failed with code: " & Err.number
WScript.Quit(3)
End If

If ObjQueryResult.Count < 1 Then
wscript.Echo "Querying for the specified DP server succeeded but no DPs were returned."
WScript.Quit(4)
End If

'Loop through the list of DPs returned

wscript.Echo "Found " & ObjQueryResult.Count & " DPs matching the specified name."

For each ObjDP in ObjQueryResult
wscript.Echo
strServeName = Replace(ObjDP.NetworkOSPath,"\","")

For each ObjProp in ObjDP.Props
If ObjProp.PropertyName = "Server Remote Name" then
If strServeName = ObjProp.Value1 then
wscript.Echo "ServerName and ServerRemoteName both match as '" & strServeName & ". Not making any change to this DP."
Else
wscript.Echo "ServerRemoteName for " & strServeName & " is " & ObjProp.Value1 & ". Correcting."
ObjProp.Value1 = strServeName
ObjDP.Put_

If Err.number <> 0 then
wscript.Echo "Saving the change failed with code: " & Err.number
Else
wscript.Echo "Successfully updated the property."
End If
End If
End If
Next
Next

??????? ????

????? ????? ???? ??????? ?? ?????? ??????? ?? ??? ????????? ???????? ??????.

???????

???? ???????: 2935813 - ????? ??? ??????: 25/???? ??????/1435 - ??????: 1.1
????? ???
  • Microsoft System Center 2012 Configuration Manager Service Pack 1
????? ??????: 
kbmt KB2935813 KbMtar
????? ????
???: ??? ????? ??? ??????? ???????? ????? ?????????? ??????? ?????? ??? ??????? ?? ??? ??????? ?? ??????? ??? ??? ?? ???? ????????? ???? ??????? ???????(CTF) ?? ?? ???? ????? ????. ???? ?? ???? ?????????? ??? ???????? ???????? ???? ??? ?? ???????? ??????? ?? ??? ??????? ???????? ?? ??? ??????? ??????? ??? ?????? ?? ?????? ??? ???? ???????? ???????? ?? ????? ??????? ????? ????? ??????. ??? ?? ???????? ???????? ?? ????? ??? ????? ?? ???????? ?? ???? ????? ?? ?????. ?????? ??? ???? ?????????? ???? ?????? ?? ??? ????? ?? ??? ??? ?? ??????? ?? ??? ????? ?? ???? ????? ????? ?? ????? ??????? ???? ?? ???????? ?? ??? ???????.
???? ??? ????? ??????? ?????? ??????????2935813

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com