본문 바로가기

반응형

Windows Server

(14)
Powershell 로 AD계정의 비밀번호 초기화 일자 추출하기 아래의 명령어를 활용하면, 대상 계정 리스트의 계정명과 함께 비밀번호 초기화 일자를 CSV 파일 형태로 추출할 수 있다. $SamAccountNames = @( "A","B" ) $CSVFile = "C:\pwdlastset.csv" foreach ($SamAccountName in $SamAccountNames) { $User = Get-ADUser -Filter { SamAccountName -eq $SamAccountName } -Properties PasswordLastSet $PasswordReset = $User.PasswordLastSet $Data = "$SamAccountName,$PasswordReset" $Data | Out-File $CSVFile -Append -Encoding U..
DNS의 조건부 전달자 List 추출하기 Windows Server의 Powershell 명령어를 활용하여, 현재 조건부 전달자(Conditonal Forwarders) 목록 전체를 CSV 파일로 추출할 수 있다. Get-DnsServerZone -ComputerName 서버명 Where-Object {$_.ZoneType -eq 'Forwarder'} | Export-Csv -NoTypeInformation DNSCFList.csv 만약, 해당 리스트를 통해 다른 Target 서버에 해당 레코드를 추가하고자 하면, 아래 명령어를 활용하면 된다. Target 서버 지정이 안되기 때문에, DNS 서버에 직접 접속 후 아래 명령어를 실행하면 된다. 대상 IP 추가는 ,형태로 multi value 추가가 가능하다. Default 옵션은 전체 DC/D..
MS SQL DB 내에서 테이블 크기 비교하기 확인하고자 하는 Database 내에서 query창을 실행한 후, 아래의 명령어를 활용하면 된다. 불필요한 로그가 있다면, 주기적으로 삭제해 주면 된다. SELECT t.NAME AS TableName, s.Name AS SchemaName, p.rows AS RowCounts, SUM(a.total_pages) * 8 AS TotalSpaceKB, SUM(a.used_pages) * 8 AS UsedSpaceKB, (SUM(a.total_pages) - SUM(a.used_pages)) * 8 AS UnusedSpaceKB FROM sys.tables t INNER JOIN sys.indexes i ON t.OBJECT_ID = i.object_id INNER JOIN sys.partitions p O..
Active Directory(AD) 서버와 통신 상태 확인하기 특정 서버나 클라이언트 대역에서 AD 서버와 통신이 가능한지 확인해 보고 싶다면, 아래 명령어를 사용하면 된다. nltest 명령어는 AD 서비스에 필요한 대부분의 TCP Port들을 활용하기 때문에, 손쉽게 네트워크 환경에 대한 점검이 가능하다. 물론 Dynamic Port나 아래 Port 이외에 다른 Port를 활용할 수 있지만, 기본적인 통신 상태를 체크하기에는 충분하다. nltest /server:AD서버명(IP or Host) /dsgetdc:도메인명(test.com) -주요 점검 포트 LDAP: TCP 389 LDAPS: TCP 636 Kerberos: TCP 88 DNS: TCP 53 SMB over IP (Microsoft-DS): TCP 445 Global Catalog LDAP: TCP..
MS SQL에서 계정에 대한 조회(Select) 권한 확인하기 MS SQL 내 생성된 계정에 대해 어떤 View/Table에 대한 조회권한이 부여된 상태인지 궁금할 때가 있다. 이럴땐 아래 Query를 활용하면 된다. 해당 Query는 sys.database_permissions 및 sys.objects 시스템 카탈로그 뷰에서 권한 정보를 가져오는 Query이다. DECLARE @UserName NVARCHAR(128) = '계정명'; SELECT USER_NAME(p.grantee_principal_id) AS UserName, o.name AS ViewName, p.permission_name AS Permission FROM sys.database_permissions p INNER JOIN sys.objects o ON p.major_id = o.object..
How to migrate SID values from A to B domain To migrate the Security Identifier (SID) values from one domain (A) to another domain (B), you can use the Microsoft SID History feature, which allows you to preserve user and group SIDs after migrating from one domain to another. Here are the basic steps for migrating SIDs from domain A to domain B: 1.Install the Active Directory Migration Tool (ADMT): You'll need to download and install the AD..
On-premises Active Directory (AD) On-premises Active Directory (AD) is a directory service provided by Microsoft for Windows-based computers and servers. It is designed to provide centralized management and control of user and group identities, credentials, and access to resources on a local network. An on-premises Active Directory provides several key features, including: User and group management: AD allows administrators to c..
Update a user's photo in Active Directory (AD). You can use PowerShell to update a user's photo in Active Directory (AD). Here are the steps to do this: 1.Connect to your AD: To connect to your AD, open PowerShell and run the following command: Import-Module ActiveDirectory 2.Get the user: To get the user that you want to update, run the following command, replacing "UserName" with the name of the user: $user = Get-ADUser -Filter "Name -eq 'U..

반응형