진화된 정품인증 스크립트

OS/Windows 2017. 2. 28. 14:17 Posted by ­행복
예전의 방법
오피스 2013 KMS가 설치된 AD환경 사용자들 중
2013이 설치된 컴퓨터들이 있는 OU에만
다음의 GPO를 적용했다.
(Computer - Policies - Windows Settings - startup script)

kms.bat
cd C:\Program Files\Microsoft Office\Office15\
cscript ospp.vbs /act




개선된 방법
if문을 활용해서 2013이 설치되지 않은 사용자들 상관없이 모든 OU에 대해 적용
scheduled task를 통해 로그온시 한번만 실행할 수 있도록 하기

배치파일자체는 스크립트를 사용해서 더 스마트한 코드를 구현
kms.bat

@echo off

set ospp="C:\Program Files\Microsoft Office\Office15\ospp.vbs"

if exist %ospp% (
cscript %ospp% /act
)