본문 바로가기

유용한 정보/· PowerShell8

UserAccount - WMI sample in Powershell ■ 원문링크 : http://www.activexperts.com/admin/scripts/wmiscripts/powershell/0683/ UserAccount - WMI sample in Powershell The foundations for Manageability in Windows 2012/2008/2003/2000/8/7/Vista/XP are Windows Management Instrumentation (WMI; formerly WBEM) and WMI extensions for Windows Driver Model (WDM). ActiveXperts Network Monitor provides the ability to build monitor check routines based on .. 2014. 9. 22.
파일 찾기 및 백업 ■ 원문링크 : Get-childitem # 특정폴더 내 모든파일 검색 PS C:\Users\oseung.chae> Get-ChildItem "D:\temp" -Recurse -Include *.* # 특정폴더 내 날짜조건 검색 (2014-09-15 이후) PS C:\Users\oseung.chae> Get-ChildItem "D:\temp" -Recurse -Include *.* | Where-Object {($_.LastwriteTime -gt "2014-09-15") -and ($_.CreationTime -gt "2014-09-15")} # 특정폴더 내 이름조건 검색 (test) PS C:\Users\oseung.chae> Get-ChildItem "D:\temp" -Recurse -Include.. 2014. 9. 15.
설치된 프로그램 Search & Uninstall Get-WmiObject win32_Product # 설치된 프로그램 찾기 PS C:\Users\oseung.chae> Get-WmiObject win32_product IdentifyingNumber : {4A03706F-666A-4037-7777-5F2748764D10} Name : Java Auto Updater Vendor : Sun Microsystems, Inc. Version : 2.0.4.1 Caption : Java Auto Updater IdentifyingNumber : {4DD6BCDF-3721-499C-A5FB-AC40F646BAC1} Name : SQL Server 2008 R2 Common Files Vendor : Microsoft Corporation Version : 10.. 2014. 9. 15.
PowerShell - 로그파일의 변경되는 내용을 실시간으로 화면에 뿌리기(Tail) 로그파일과 같이 실시간으로 변하는 내용을 화면에서 보고자 할때 사용할 수 있는 간단한 방법입니다. 명령어 정말 간단하죠? PS C:\Users\oseung.chae> Get-Content D:\log\test.log -Wait 테스트입니다. 파일이 변경될 때마다 화면에 보여주는군요... 잘 보이시죠~? 한번에 두개의 라인이 추가되면 어떨까요? 1 2 그럼 이번에는 3개 라인을 해볼까요? 1 2 3 응용하면 아래와 같겠죠~? PS C:\Users\oseung.chae> $logPath = 'D:\log' PS C:\Users\oseung.chae> $latestFileName = Get-ChildItem $logPath | Sort Date -Descending | Select-Object -First 1.. 2014. 9. 13.
PowerShell - Function 이용하기 사용자가 Function을 이용할 수 있도록 제공하고 있다. 아래는 간단한 예제이며, 원하는 형태로 활용할 수 있을 듯.... PS C:\Users\oseung.chae> function fc_echo() >> { >> echo 'function 테스트입니다.' >> echo '화면에 잘 보이시죠?' >> } >> PS C:\Users\oseung.chae> fc_echo function 테스트입니다. 화면에 잘 보이시죠? PS C:\Users\oseung.chae> 2014. 9. 13.
PowerShell을 이용한 이벤트 로그 설정 ▒ 이벤트 로그 설정 확인 PS C:\Users\oseung.chae> Get-EventLog -List Max(K) Retain OverflowAction Entries Log ------ ------ -------------- ------- --- 20,480 0 OverwriteAsNeeded 14 Application 20,480 0 OverwriteAsNeeded 0 HardwareEvents 512 7 OverwriteOlder 0 Internet Explorer 20,480 0 OverwriteAsNeeded 0 Key Management Service 20,480 0 OverwriteAsNeeded 83 Lenovo-Customer Feedback 512 7 OverwriteOlder 0 .. 2014. 9. 13.
Windows PowerShell Technet 자료 참고사이트 : http://technet.microsoft.com/ko-kr/scriptcenter/powershell.aspx 메뉴얼 : http://technet.microsoft.com/library/ee221100.aspx Windows PowerShell을 사용한 스크립팅 Windows PowerShell 명령줄 및 스크립팅 환경에 관심이 있는 시스템 관리자를 위한 모든 리소스가 있습니다. 사이트를 더 유용하게 만드는 데 대한 의견이 있으시면 여기로 보내주십시오. 2014. 9. 13.
Windows PowerShell 이란? MS Windows PowerShell은 시스템 관리 및 자동화 등을 목적으로 설계된 명령줄 셸 및 스트립팅 언어다. 일반적으로 Unix, Linux 등에서 접해본 Shell과 상당히 유사하며, 커멘드 기반의 화면에서 시스템의 상태 모니터링, 설정변경, 서비스 제어 등을 할 수 있는 환경을 제공한다. Windows Server 2008 R2 및 Windows 7에서는 Windows PowerShell 2.0을지원하고, Windows Server 2012 및 Windows 8에서는 Windows PowerShell 3.0을지원 합니다. OS의 기본 기능 외에 추가 기능(ActiveDirectory Domain Services, Windows BitLocker Drive Encryption, DHCP Ser.. 2014. 9. 13.