RedPlug's Tory

Get-OSCounts.zip
0.00MB

 

원본스크립트의 경우 OS버젼과 에디션 까지만 나오며,

현재 Windows 10의 경우 빌드업으로 진행하다보니 해당 부분이 구분이 가지 않아

빌드넘버가 찍히는 OperatingSystemVersion 관련 내용 추가하였으며, 

빌드넘버보다는 빌드버젼으로 많이 확인하기 때문에 해당 부분변경하는 내용까지 추가하였습니다.

(명칭이 넘버 버젼이 맞는지는 정확히 모르겠네요)

 

추가로 빌드업이 나올 때마다 $Computer.OperatingSystemVersion 값을 넣는 부분에 replace

를 추가해주어야 함. (버젼으로 보려고 할 경우 수정필요X)

 

 

원본 출처 : 

https://gallery.technet.microsoft.com/scriptcenter/List-OS-version-counts-2d330a33

isochange.zip
0.00MB

Hyper-V VDI 구성하여 운영 중이며 VM내 필요한 설치파일에 대하여 ISO파일을 CD로 넣어서 제공하고 있는 상태이며, 

해당 이미지 파일에 대하여 일괄 변경하기 위한 스크립트 입니다.

isochangepath.txt : ISO파일 위치 기입

ps1 파일 내 $VMName 에 대하여서는 확인 후 필요 시 변경

 

 

소프트웨어 배포를 위해 설정 했던 그룹정책의 배포 원본 경로를 변경 하는 방법을 설명합니다.

 

기존 배포 지점 확인

해당 변경하고자 하는 소프트웨어의 속성 > 배포 > 고급 >스크립트 이름에서 Polices 다음 값(클래스ID)를 확인

ADSI 편집 > 기본 명명 컨텍스트 > System > Policies > 상기 클래스ID > Machine > Class Store > Packages > 우측에 나오는 값 속성 > 특성 편집기에서 msiFileList 값 수정

수정 시 UNC경로 앞에 0:을 붙여서 추가 한 후에 기존 패키지 주소는 삭제 하면됩니다.

(패키지 수정탭에 내용이 있을 경우 1:이 추가로 표시될 수 있음.)

 

 

정책 새로 고침 후 변경사항 확인

regedit > HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\PortNumber

> 상기 값을 원하는 값으로 변경(변경 시 10진수로 변경)

 

변경 후 재부팅 필요.

 

 

커맨드

REG add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v PortNumber /t REG_DWORD /d 7067 /f

 

현재 설정 포트 확인

for /f "tokens=3" %F in ('reg query "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v PortNumber ^| find "REG_DWORD"') do set /a decval=%F
C:\Users\redplug>for /f "tokens=3" %F in ('reg query "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v PortNumber ^| find "REG_DWORD"') do set /a decval=%F

C:\Users\redplug>set /a decval=0x1b9b
7067
C:\Users\redplug>

 

방화벽추가

netsh advfirewall firewall add rule name="RDP 7067 TCP Allow" dir=in action=allow enable=yes profile=any protocol=tcp localport=7067

 

 

 

@작업용(관리자 권한으로 실행 필요)

:: 현재 RDP Port Check ::
for /f "tokens=3" %F in ('reg query "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v PortNumber ^| find "REG_DWORD"') do set /a decval=%F

:: RDP Port 변경 ::
REG add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v PortNumber /t REG_DWORD /d 53389 /f


:: 방화벽 생성 ::
netsh advfirewall firewall add rule name="RDP 53389 TCP Allow" dir=in action=allow enable=yes profile=any protocol=tcp localport=53389 


:: 현재 RDP Port Check ::
for /f "tokens=3" %F in ('reg query "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v PortNumber ^| find "REG_DWORD"') do set /a decval=%F

:: 방화벽 생성 확인 ::
netsh advfirewall firewall show rule "RDP 53389 TCP ALlow"

 

 

출처 : https://support.microsoft.com/ko-kr/help/306759/how-to-change-the-listening-port-for-remote-desktop

Active Directory Group Policy 내 사용자 그룹 정책(Logon정책)으로 배포하기 위한 스크립트 샘플

@echo off
title Program install chk.
 
echo Windows 10 Check
ver | find "10.0" > nul
if %ERRORLEVEL% == 0 goto start
 
goto end
:start
 
echo Program Install chk
IF NOT EXIST "C:\Program Files\Program\redplug\redplug.exe" (
   GOTO :filecopy
) ELSE (
   del C:\ProgramData\setup64.exe
   rd c:\ProgramData\ProgramInstall
   GOTO :end
)
 
:filecopy
echo Program file copy
IF EXIST c:\ProgramData\ProgramInstall\setup64.exe GOTO :install
md c:\ProgramData\ProgramInstall
 
copy \\filesever\redplug\setup64.exe c:\ProgramData\ProgramInstall
 
:install
echo Program file copy OK
call c:\ProgramData\ProgramInstall\setup64.exe /s /v"/qb"
 
:end
@echo success
echo Program chk end

필요한경우 bits를 이용해 http로도 다운로드를 변경해서 사용이 가능

bitsadmin.exe /transfer "Filedownload" http://downloadsite.com/downloadfile.exe c:\ProgramData\ProgramInstall\downloadfile.exe

1. CMD SystemInfo

SystemInfo | findstr "KB4499164"

오래된 시스템일 경우 업데이트가 많아 검색이 안되는 경우가 발생, 화면상에 노출되지 않는 상태라 발생하는 문제로 보여짐(테스트 Windows 2008 R2), 약 200개가 넘어갈 경우 노출되지 않음

 

2. Powershell

Get-Hotfix | Out-String -Stream | Select-String “KB4499164”

 

3. CMD WMIC

WMIC QFE LIST | FINDSTR “KB4499164”

 




Windows 2016 설치 후 대쉬보드 내 서비스 란에 MapsBroker, OneSyncSvc 오류가 뜰 경우 해결방법

서비스 시작안함으로 변경

 sc config “OneSyncSvc” start= disabled

 sc config “MapsBroker” start= disabled


This services are OneSyncSvc (synchronizes mail, contacts, calendar and various other user data) and Download Maps Manager (for application access to downloaded maps) and are really not critical on server OS.


https://msdn.microsoft.com/en-us/library/mt708806(v=vs.85).aspx


Windows Server Core서버에 파일 복사하기

$ip = "CoreServerIP"  # replace with your Nano Server's IP address

$s = New-PSSession -ComputerName $ip -Credential "coreserveraccount" 


Copy-Item -ToSession $s -Path SourcePath -Destination DestinationPath






WIndows Server군에 대한 AV(Anti Virus) 예외 처리 항목 list입니다.


https://social.technet.microsoft.com/wiki/contents/articles/953.microsoft-anti-virus-exclusion-list.aspx


RSS 피드

https://social.technet.microsoft.com/wiki/contents/articles/953.microsoft-anti-virus-exclusion-list/rss.aspx

https://www.microsoft.com/en-us/download/details.aspx?id=53353


설치 시 SQL Express 설치 필요.

Update Check : Ctrl + U