달력

5

« 2024/5 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

Office 365에서 회의실 사서함의 기본 권한 설정


PowerShell 실행 후


$UserCredential = Get-Credential -UserName <Office 365 관리자 계정> -Message "Connecting Office 365..."

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

Import-PSSession $Session



일정 있음/없음, 일정 제목 및 위치 보기 권한

Set-MailboxFolderPermission -Identity "<회의실 계정>:\calendar" -AccessRights LimitedDetails -User default


일정 있음/없음, 일정 제목, 위치 및 상세 내용 보기 권한

Set-MailboxFolderPermission -Identity "<회의실 계정>:\calendar" -AccessRights Reviewer -User default




:
Posted by 커널64

On-premise의 AD를 원본으로 두고 DirSync를 통해 Office 365를 사용하고 있는 경우, Office 365 상의 계정 정보는 Read-Only가 되므로, 계정 설정에 대한 변경 작업의 상당수는 동작하지 않습니다.


예를 들어, 다음과 같이 특정 계정 또는 그룹 계정을 '주소 목록에서 숨김' 기능을 사용하려고 하면 오류가 발생합니다.


한글

'OOOO' 개체는 온-프레미스에서 동기화되고 있으므로 작업 'Set-DistributionGroup', 'HiddenFromAddressListsEnabled'은(는) 해당 개체에서 수행할 수 없습니다. 이 작업은 온-프레미스 조직의 개체에 대해 수행해서는 안 됩니다.


영문

The action 'Set-DistributionGroup', 'HiddenFromAddressListsEnabled', can't be performed on the object 'OOOO' because the object is being synchronized from your on-premises organization. This action should be performed on the object in your on-premises organization.


이러한 경우, On-Premise AD에 대한 속성 MsExchHideFromAddressLists 값을 TRUE로 설정한 후 동기화되도록 해야 합니다.


그런데, 현재 On-premise 환경에는 Exchange 인프라가 없는 상태입니다.

그렇기 때문에 MsExchHideFromAddressLists 속성이 없습니다.


위와 같이 현재 On-premise에 Exchange 인프라가 없는 경우 다음 절차를 참고해 진행합니다.


1. Exchange Server의 설치 미디어를 준비합니다. 체험판도 상관없습니다.

http://www.microsoft.com/download/en/details.aspx?id=21570


2. 압축을 해제한 Enterprise Admins 및 Schema Admins 구성원 계정으로 다음 명령을 실행하고 기다립니다.

Setup /PrepareSchema



3. 명령이 정상적으로 수행된 것을 확인한 후 ADSI 편집기 또는 ADUC의 View -> Advanced Features 체크 후 계정의 속성 창을 열어 속성 편집기 탭에서 필요한 속성을 수정하실 수 있습니다.




:
Posted by 커널64

Office 365, Azure Active Directory를 사용하실 때 On-Premise에 있는 도메인 컨트롤러의 정보를 Azure Active Directory로 동기화를 위해 Windows Azure Active Directory Sync 도구를 많이 사용하십니다.


기본적으로 동기화 주기가 3시간으로 설정되어 있는데, 이 주기를 변경하는 옵션이 GUI 상에는 보이지 않습니다.

다음 절차를 통해 동기화 주기 변경이 가능합니다.


1. C:\Program Files\Windows Azure Active Directory Sync 디렉터리로 이동합니다.


2. Microsoft.Online.DirSync.Scheduler.exe.Config 파일을 메모장으로 엽니다.


3. 파일의 내용 중 붉은 부분의 내용을 변경합니다.

   예를 들어, 30분으로 변경하고자 하는 경우 <add key="SyncTimeInterval" value="0:30:0" /> 으로 설정합니다.


<?xml version="1.0" encoding="utf-8"?>

<configuration>

  <appSettings>

    <!--the interval in hours-->

    <!--refer for valid values:http://msdn2.microsoft.com/en-us/library/system.timespan.parse.aspx-->

    <add key="SyncTimeInterval" value="3:00:0" />

  </appSettings>

  <startup>

    <supportedRuntime version="v4.0" />

  </startup>

</configuration>


4. 변경 후 서비스 콘솔을 열어 Windows Azure Active Directory Sync Service 서비스를 재시작합니다.



:
Posted by 커널64

AWS의 ELB(Elastic Load Balancing)과 Auto Scaling 사용 시 Scale in 이 발생하는 경의 기본 정책은 다음과 같습니다.

 

 

 

 

기본적으로, 가용성을 최우선 순위로 하며, 순서적으로 정리하면 다음과 같습니다.

Scale-in 이 발생할 때의 순서이며, 해당하는 EC2 인스턴스가 하나이면 종료됩니다.

 

1) 다중 가용존(Muliple AZ) 구성의 경우, EC2 인스턴스가 가장 많은 AZ 선택

2) 가장 오래된 Launch Configuration으로 구동된 EC2 인스턴스(들) 선택

3) 구동 시간 기준으로 다음 과금 시간에 가장 가까운 EC2 인스턴스(들) 선택

4) 위 과정을 거쳤으나 선택된, 해당되는 EC2 인스턴스가 여러 개일 경우 무작위 선택

 

 

 

:
Posted by 커널64
2015. 3. 26. 09:39

AWS EC2 리눅스 인스턴스 로그인 방식 변경 Etc.2015. 3. 26. 09:39

기본적으로 AWS에서 Linux EC2 인스턴스를 생성하면, 인증서를 이용해 로그인하도록 되어 있습니다.


보안적으로는 이 방법이 권장되나, 테스트 환경 등에서는 불편할 수 있습니다.

로그인 방식을 기존 인증서 방식과 더불어 ID, P/W로 로그인할 수 있도록 아래와 같이 합니다.


우선 Linux 인스턴스에 로그인 후


1) root 계정에 대한 암호를 설정합니다.

sudo passwd root


2) sshd 설정 파일을 열어

sudo vi /etc/ssh/sshd_config


3) 아래 부분을 수정합니다.

# Change to no to disable tunnelled clear text passwords

PasswordAuthentication no


# Change to no to disable tunnelled clear text passwords

PasswordAuthentication yes


4) 마지막으로, 인증서를 root 계정에 복사합니다.

sudo cp /home/<User Account>/.ssh/authorized_keys /root/.ssh/




:
Posted by 커널64

' Event Log is Full, Export and Clear (이벤트 기록: ID 9002)

' Event Log: Operations Manager, Event Source: Health Service Script


CONST EventID = 9002

CONST USAGE_LIMIT = 95

CONST MAX_FILES = 5


ScriptName = ""


Set oArgs = WScript.Arguments

TargetBackupPath = ""

If oArgs.Count > 1 Then

  For i = 0 to oArgs.Count-1

    TargetBackupPath = TargetBackupPath & oArgs(i) & " "

  Next

  TargetBackupPath = Trim(TargetBackupPath)

Else

  TargetBackupPath = Trim(oArgs(0))

End If


CONST INFORMATION = 0

CONST ERROR = 1

CONST WARNING = 2


Set oFSO = CreateObject("Scripting.FileSystemObject")


On Error Resume Next


Set objFolder = oFSO.GetFolder(TargetBackupPath)

If Err.Number <> 0 Then

  Set objFolder = NOTHING

  Set oFSO = NOTHING

  WScript.Quit

Else

  Set wshNetwork = WScript.CreateObject( "WScript.Network" )

  strComputerName = Ucase(wshNetwork.ComputerName)

  Set wshNetwork = NOTHING

  

  Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\.\root\cimv2")

  Set colItems = objWMIService.ExecQuery ("Select * from Win32_NTEventLogFile Where LogfileName = 'Application' OR LogfileName = 'System'")

  

  For Each Item in colItems

    tmpUsage = Round((Item.FileSize/Item.MaxFileSize)*100,0)

    tmpLogName = Item.LogfileName

    tmpLogExt = Item.Extension

    

    If tmpUsage > USAGE_LIMIT Then

      Set colLogFiles = objWMIService.ExecQuery("Select * from Win32_NTEventLogFile Where LogFileName='"&tmpLogName&"'")

      For Each objLogfile in colLogFiles

        PreDateTime = cDate(Now)

        PreDateTime = Year(PreDateTime)&Right("0"&Month(PreDateTime),2)&Right("0"&Day(PreDateTime),2)&Right("0"&Hour(PreDateTime),2)&Right("0"&Minute(PreDateTime),2)

        objLogFile.BackupEventLog(TargetBackupPath & "\" & strComputerName & "_" & tmpLogName & "_" & PreDateTime & "." & tmpLogExt)

        objLogFile.ClearEventLog()

        strMessage = tmpLogName & " event log has been cleared. Export path: " & TargetBackupPath & "\" & strComputerName & "_" & tmpLogName & "_" & PreDateTime & "." & tmpLogExt

        Set oAPI = CreateObject("MOM.ScriptAPI")

        Call oAPI.LogScriptEvent(ScriptName, EventID, INFORMATION, strMessage)

        Set oAPI = NOTHING

      Next

      Set colLogFiles = NOTHING

    End If

    

  Next

  Set colItems = NOTHING

  Set objWMIService = NOTHING

  Set colFiles = objFolder.Files

  

  Do While colFiles.Count > MAX_FILES

    Set colFiles = objFolder.Files

    dtmOldestDate = Now

    For Each objFile in colFiles

      If objFile.DateCreated < dtmOldestDate Then

        dtmOldestDate = objFile.DateCreated

        strOldestFile = objFile.Path

      End If

    Next

    oFSO.DeleteFile(strOldestFile)

  Loop

  Set colFiles = NOTHING

  objFolder = NOTHING

  Set oFSO = NOTHING

End If


:
Posted by 커널64

Set oArgs = WScript.Arguments


If oArgs.Count = 0 Then

  WScript.Echo "Argument was not provided."

  WScript.Quit

End If


strDirectory = ""

If oArgs.Count > 1 Then

  For i = 0 to oArgs.Count - 1

    strDirectory = strDirectory & oArgs(i) & " "

  Next

Else

  strDirectory = oArgs(0)

End If


Set oFSO = CreateObject("Scripting.FileSystemObject") 


Set Folder = oFSO.GetFolder(strDirectory)

Set Files = Folder.Files

NumOfFiles = Files.Count


Set Files = NOTHING

Set Folder = NOTHING

Set oFSO = NOTHING


WScript.Echo strDirectory & vbCRLF

WScript.Echo "# of Files: " & NumOfFiles





:
Posted by 커널64
2015. 1. 13. 21:47

VBS - 파일 수정 날짜 쿼리 (매개 변수) Etc.2015. 1. 13. 21:47

Set oArgs = WScript.Arguments


If oArgs.Count = 0 Then

  WScript.Echo "Argument was not provided."

  WScript.Quit

End If


strFilePath = ""

If oArgs.Count > 1 Then

  For i = 0 to oArgs.Count - 1

    strFilePath = strFilePath & oArgs(i) & " "

  Next

Else

  strFilePath = oArgs(0)

End If


Set sFSO = CreateObject("Scripting.FileSystemObject")

Set f = sFSO.GetFile(strFilePath)

FileModifiedDate = cDate(f.DateLastModified)


Set f = NOTHING

Set sFSO = NOTHING


WScript.Echo strFilePath & vbCRLF

WScript.Echo "Modified Date: " & FileModifiedDate



:
Posted by 커널64

On Error Resume Next


Set objFwMgr = CreateObject("HNetCfg.FwMgr")

Set objProfile = objFwMgr.LocalPolicy.CurrentProfile


If Err <> 0 Then

  WScript.Echo "Windows Firewall Service is not running."

  WScript.Quit

End If


If objProfile.FirewallEnabled = True Then

  WScript.Echo "Windows Firewall is enabled."

Else

  WScript.Echo "Windows Firewall is disabled."

End If




:
Posted by 커널64

Const DOMAIN_PROFILE = 1

Const PRIVATE_PROFILE = 2

Const PUBLIC_PROFILE = 4


Set fwPolicy2 = CreateObject("HNetCfg.FwPolicy2")


CurrentProfile = fwPolicy2.CurrentProfileTypes

Select Case CurrentProfile

  Case DOMAIN_PROFILE

    WScript.Echo "현재 프로필: 도메인"

  Case PRIVATE_PROFILE

    WScript.Echo "현재 프로필: 개인"

  Case PUBLIC_PROFILE

    WScript.Echo "현재 프로필: 공용"

End Select


WScript.Echo "==================="


If fwPolicy2.FirewallEnabled(DOMAIN_PROFILE) = TRUE Then

  WScript.Echo "도메인 프로필: 사용"

Else

  WScript.Echo "도메인 프로필: 사용 안 함"

End If


If fwPolicy2.FirewallEnabled(PRIVATE_PROFILE) = TRUE Then

  WScript.Echo "개인 프로필: 사용"

Else

  WScript.Echo "개인 프로필: 사용 안 함"

End If


If fwPolicy2.FirewallEnabled(PUBLIC_PROFILE) = TRUE Then

  WScript.Echo "공용 프로필: 사용"

Else

  WScript.Echo "공용 프로필: 사용 안 함"

End If


Set fwPolicy2 = NOTHING




:
Posted by 커널64