Posts

Collect AzureStack Update Verbose log

Image
The following commands will collect "UpdateVerboseLog". 1. Create a PEP session, in this example $pepsession is the name of established PEP session $pepsession = New-PSSession -ComputerName ercs_ip -ConfigurationName PrivilegedEndpoint -Credential (get-credential) 2. Collect verbose log $log = Invoke-Command -Session $pepsession -ScriptBlock { Get-AzureStackUpdateVerboseLog } 3. Save it to local folder $log > “c:\temp\UpdateVerboseLog.txt” 4. Example

Ubuntu : Installing Apache

Installing Apache, root@th-ubuntu2:/home/taehee# apt update root@th-ubuntu2:/home/taehee# apt install apache2 root@th-ubuntu2:/home/taehee# ufw allow 'Apache' root@th-ubuntu2:/home/taehee# service apache2 status ● apache2.service - The Apache HTTP Server    Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset:   Drop-In: /lib/systemd/system/apache2.service.d            └─apache2-systemd.conf    Active: active (running) since Mon 2019-04-15 09:19:48 UTC; 1min 31s ago  Main PID: 19093 (apache2)     Tasks: 55 (limit: 4708)    CGroup: /system.slice/apache2.service            ├─19093 /usr/sbin/apache2 -k start            ├─19094 /usr/sbin/apache2 -k start            └─19095 /usr/sbin/apache2 -k start Apr 15 09:19:48 th-ubuntu2 systemd[1]: Starting The Apache HTTP Server... Apr 15 09:19:48 th-ubuntu2 apachectl[19068]: AH00558: apache2: Could not reliabl Apr 15 09:19:48 th-ubuntu2 systemd[1]: Started The Apache HTTP Server. Enable http

Check Linux VM's network connections

1. root@linux:/# cat /etc/resolv.conf # This file is managed by man:systemd-resolved(8). Do not edit. # # This is a dynamic resolv.conf file for connecting local clients to the # internal DNS stub resolver of systemd-resolved. This file lists all # configured search domains. # # Run "systemd-resolve --status" to see details about the uplink DNS servers # currently in use. # # Third party programs must not access this file directly, but only through the # symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way, # replace this symlink by a static file or a different symlink. # # See man:systemd-resolved.service(8) for details about the supported modes of # operation for /etc/resolv.conf. nameserver 127.0.0.53 search 6e857bc1-b353-4193-8cc6-d8be8f7b24d1.internal.lnv4.azurestack.local 2. root@linux:/# nslookup -debug google.com Server:         127.0.0.53 Address:        127.0.0.53#53 Non-authoritative answer: Name:   google.com Addr

Azure Stack Powershell - Create a VM using uploaded VHD

The script will use existing resources(RG/NIC) Azure Stack $location = "YOURLOCATION" $rgname = "YOURRG" $vmname = "YOURVMNAME" $osVHD = "https://FQDN/storageaccount/osdiskname.vhd" $vm = New-AzureRmVMConfig -VMName $vmname -VMSize "Standard_A4_v2" $vm = Set-AzureRmVMOSDisk -VhdUri $osVHD -Name $vmname-OSDisk -CreateOption attach -Linux -Caching ReadWrite -VM $vm1 $nic = get-azurermnetworkinterface -name $vmname-NIC1 -ResourceGroupName $rgname $vm1 = Add-AzureRmVMNetworkInterface -VM $vm1 -ID $nic.id New-AzureRMVM -ResourceGroupName $rgname -Location $location $vm1 -Verbose Azure Create a virtual machine using an existing managed OS disk with PowerShell

AAD Connect : How to add an OU to be synced

Image
Here goes to add an OU for AAD Connect sync. 1. Open AAD Connect Synchronization Service Manager 2. Select on-prem AD connector and click Properties 3. Configure Directory Partitions -> Containers 4. Enter Password and click OK 5. Select an OU to be added, "AAD Connect" in this example 6. Create an user for test 7. A new user, "new_aad" created 8. "new_aad" not listed in O365 portal 9. Start AAD sync "Delta" 10. "new_aad" is synced/listed in O365 portal  

AADConnect PowerShell: Manual operations

Importing PowerShell Module Import-Module ADSync Check current sync schedule Get-ADSyncScheduler To set sync interval to every 3 hours Set-AdSyncScheduler -customizedsycncecleinterval 03:00:00 Start by telling the scheduler to stop its current cycle with the PowerShell cmdlet  Stop-ADSyncSyncCycle To initiate a full sync cycle, run Start-ADSyncSyncCycle -PolicyType Initial Force Synchronisation It could be that you have an urgent change which must be synchronized immediately which is why you need to manually run a cycle. Start-ADSyncSyncCycle -PolicyType Delta To check current sync status Get-ADSyncConnectorRunStatus Example , PS C:\Users\Administrator> Start-ADSyncSyncCycle -PolicyType Delta PS C:\Users\Administrator> Get-ADSyncConnectorRunStatus  RunState ConnectorName  -------- -------------  Busy mfa01.onmicrosoft.com - AAD Manual sync for password $adConnector  = "mfalab3.com" $aadConnector = "mfa01.onmicrosoft.com -

Remove Office 365 federation from ADFS server

1. Check federation status, PS C:\Users\administrator> Get-MsolDomain | fl name,status,auth* Name           : mfalab3.com Status         : Verified Authentication : Federated 2. From ADFS server, run following Powershell commands. Set-MsolADFSContext -Computer th-adfs2012 Set-MsolDomainAuthentication -Authentication Managed -DomainName mfalab3.com Get-MsolDomain | fl name,status,auth* (Note : th-adfs2012 : adfs server, mfalab3.com : test domain name) 3. Check federation status again, PS C:\Users\administrator> Get-MsolDomain | fl name,status,auth* Name           : mfalab3.com Status         : Verified Authentication : Managed 4. Login to O365 to check if it is not redirected to ADFS server