PowerShell 예제

System.Security.SecureString 유형의 암호 만들기

참고: 일반 텍스트 암호를 사용하는 구성된 PowerShell 스크립트가 Arcserve UDP 6.5에 있는 경우 $SecurePassword를 사용하거나 암호 파일을 사용하도록 수정하십시오.

설명

이 명령은 System.Security.SecureString 유형의 암호를 만드는 데 사용되며 다른 모든 명령에서도 사용됩니다. System.Security.SecureString은 시스템에 미리 정의된 유형입니다. 이 유형을 생성하는 방법은 여러 가지가 있습니다. 일반적으로 다음 두 가지 유형이 서로 다른 용도로 사용됩니다.

예제 1

설명

이 명령은 보안 암호를 암호화하여 암호 파일에 저장합니다.

C:\PS>UDPPowerCLI.ps1 -Command CreatePswFile -Password $SecurePassword -PasswordFile myUDPPasswordFile

예제 2

설명

로컬 서버에서 이 명령은 HTTP 프로토콜을 사용하여 포트 8015를 통해 UDP 콘솔에 연결한 다음, myplan이라는 계획을 위한 증분 백업 작업을 제출합니다.

C:\PS>UDPPowerCLI.ps1 -Command Backup -UDPConsoleUserName myUsr -UDPConsolePassword $SecurePassword -PlanName myPlan -BackupJobType Incr

예제 3

설명

로컬 서버에서 이 명령은 HTTP 프로토콜을 사용하여 포트 8015를 통해 UDP 콘솔 서비스에 연결한 다음, myNodeName이라는 노드를 위한 증분 백업 작업을 제출합니다.

C:\PS>UDPPowerCLI.ps1 -Command Backup -UDPConsoleUserName myUsr -UDPConsolePasswordFile myUDPPasswordFile -NodeName myNodeName -BackupJobType Incr

예제 4

설명

이 명령은 HTTPS 프로토콜을 사용하여 포트 8015을 통해 myServer라는 이름의 서버에 있는 UDP 콘솔 서비스에 연결한 다음, myPlan이라는 계획을 위한 전체 백업 작업을 제출하고, 작업 설명을 myJob이라고 지정합니다.

C:\PS>UDPPowerCLI.ps1 -Command Backup -UDPConsoleServerName myServer -UDPConsoleProtocol https -UDPConsolePort 8015 -UDPConsoleUserName myUsr -UDPConsolePassword $SecurePassword -UDPConsoleDomainName myDomain -PlanName myPlan -BackupJobType Full -JobDescription myJob

예제 5

설명

이 명령은 HTTP 프로토콜을 사용하여 포트 8014를 통해 yourUDPAgentServer라는 서버의 UDP 에이전트 서비스에 연결한 다음, yourUDPAgentServer를 위한 증분 백업 작업을 제출합니다.

C:\PS>UDPPowerCLI.ps1 -Command Backup -UDPAgentServerName yourUDPAgentServer -UDPAgentPasswordFile myUDPAgentPasswordFile -BackupJobType Incr

예제 6

설명

이 명령은 매개 변수 이름을 단축합니다.

C:\PS>UDPPowerCLI.ps1 -Cmd Backup -Svr myServer -Ptc https -Prt 8014 -Usr myUsr -Psw $SecurePassword -Dmn myDomain -Pln myPlan -Jbt Full -Jbd myJob

예제 7

설명

이 명령은 환경의 사용자 이름, 기본 HTTP 프로토콜 및 포트 8014를 사용하여 yourUDPAgentServer라는 서버에 연결합니다. 이 명령은 yourUDPAgentServer 백업 구성에서 백업 세션 번호가 1임을 확인한 다음, 복원 옵션을 "기존 파일 덮어쓰기"로 선택하여 해당 디렉터리를 원본 위치로 복원합니다.

C:\PS>UDPPowerCLI.ps1 -Command restore -UDPAgentServerName yourUDPAgentServer -UDPAgentPasswordFile myUDPAgentPasswordFile -RestoreDirectoryPath 'c:\Test' -BackupSessionNumber 1

예제 8

설명

이 명령은 HTTP 프로토콜 및 포트 8014을 사용하여 yourUDPAgentServer라는 서버에 연결합니다. 이 명령은 yourUDPAgentServer 백업 구성에서 백업 세션 번호가 1임을 확인한 다음, 1.txt 파일을 대체 위치로 복원합니다.

C:\PS>UDPPowerCLI.ps1 -Command restore -UDPAgentServerName yourUDPAgentServer -UDPAgentUserName UDPAgentUsername -UDPAgentPasswordFile myUDPAgentPasswordFile -UDPAgentProtocol 'https' -UDPAgentPort 8014 -UDPAgentDomainName UDPAgentdomainName -BackupSessionNumber 1 -RestoreFilePath 'C:\1.txt' -RestoreDestination 'C:\restore' -RestoreDestinationUserName remoteAccessUser -RestoreDestinationPassword remoteAccessPsw

예제 9

설명

이 명령은 환경의 사용자 이름, 기본 HTTP 프로토콜 및 포트 8014를 사용하여 yourUDPAgentServer라는 서버에 연결합니다. 그런 다음 기본 포트 8015 및 프로토콜 HTTP를 사용하여 UDP 서버에 연결하여 백업 세션 번호가 1임을 확인합니다. 마지막으로, 복원 옵션을 "기존 파일 덮어쓰기 및 루트 디렉터리 생성"으로 선택하여 디렉터리를 대체 위치로 복원합니다.

C:\PS>UDPPowerCLI.ps1 -Command restore -UDPAgentServerName yourUDPAgentServer -UDPAgentPasswordFile myUDPAgentPasswordFile -RestoreDirectoryPath 'c:\Test' -BackupSessionNumber 1 -RestoreDestination 'C:\restore' -RestoreDestinationUserName remoteAccessUser -RestoreDestinationPassword remoteAccessPsw -UDPConsoleServerName yourUDPServer -vmname sourceVMName -UDPConsolePasswordFile myUDPPasswordFile -domainname yourUDPDomainName -OverwriteExistFiles 'true' -CreateRootFolder 'true'

예제 10

설명

이 명령은 환경의 사용자 이름, 기본 HTTP 프로토콜 및 포트 8014를 사용하여 yourUDPAgentServer라는 서버에 연결합니다. 그런 다음 기본 포트 8015 및 프로토콜 HTTP를 사용하여 UDP 서버에 연결하여 백업 세션 번호가 1임을 확인합니다. 마지막으로, 복구 VM 옵션을 "기존 VM 덮어쓰기 및 복구 후에 VM 전원 켜기"로 선택하여 VM을 원래 위치로 복구합니다.

C:\PS>UDPPowerCLI.ps1 -Command RecoverVM -UDPAgentServerName yourUDPAgentServer -UDPAgentPasswordFile myUDPAgentPasswordFile -BackupSessionNumber 1 -UDPConsoleServerName yourUDPServer -recovervmname sourceVMName -UDPConsolePasswordFile myUDPPasswordFile -UDPConsoleDomainName yourUDPDomainName -OverwriteExistingVM 'true' -PoweronVM 'true'

예제 11

설명

이 명령은 UDP 에이전트의 주간 백업 작업을 즉시 제출하고 한 번만 실행합니다.

C:\PS>UDPPowerCLI.ps1 -Command Backup -UDPAgentServerName myServer -UDPAgentPassword $SecurePassword -UDPAgentDomainName myDomainName -UDPAgentUserName UDPAgentUsername -BackupJobType Incr -backupScheduleType 'weekly' -jobDescription 'PowerCLIJob'

예제 12

설명

이 명령은 백업 작업을 제출하고 작업이 완료될 때까지 대기할 시간 제한을 초 단위로 설정합니다.

C:\PS>UDPPowerCLI.ps1 -Command Backup -UDPConsoleServerName myServer -UDPConsolePasswordFile myUDPPasswordFile -UDPConsoleDomainName myDomainName -nodeName myNodeName -UDPConsoleUserName myAdmin -BackupJobType Incr -jobDescription 'PowerCLIJob' waitJobFinish 'true' -timeout 600 -jobType 'agentbase'