misOrz

IT Tech & Life

Using UserAccountControl Flags to Manipulate Properties (LDAP, AD)

 userAccountControl == 66048 (512+65536) 

 userAccountControl == 66050 Disabled, Don’t Expire Password

 userAccountControl == 514 (512+2) Account Disable





Reference: https://shellgeek.com/useraccountcontrol-flags-to-manipulate-properties/#UserAccountControl_66050_Disabled_and_Dont_Expire_Password


How to Perform an Offline Domain Join in Active Directory

DJOIN: offline junction

The djoin command allows to join a computer offline, this junction is done in two steps:

  • Provision of the post in the Active Directory with the generation of a metadata file.
  • Join the computer to the domain with the file.
domain : Active Directory domain name
machine : computer account name
savefile : location and name of the file containing the metadata.

djoin /provision /domain DDCO /machine PC0577 /savefile C:\PC0577_join

or

djoin /provision /domain DDCO /machine PC0577 /savefile C:\PC0577_join /reuse


requestodj : junction to offline domain at next reboot
loadfile : file containing the metadata
windowspath : Windows installation folder, it is to use the following variables in the command% systemroot% or% windir%
localos : target the local operating system

djoin /requestodj /loadfile D:\PC0577_join /windowspath %windir% /localos

and

Restart-Computer




Getting the name of the current Windows user returning “IIS APPPOOL/Sitename”


string user = System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString();


  1. Enable Windows authentication
  2. Disable anonymous authentication
  3. Add <identity impersonate="true"> in web.config


 <system.web>
    ...
    <authentication mode="Windows"/>
    <identity impersonate="true"/>
    ...
 </system.web>

netstat use find filter on windows

netstat -anot | find "10.1.2.3:8081" | find /v "UDP"






『Proto』代表協議,有TCP和UDP兩種協議。
『Local Address』代表本機地址,該位址冒號後的數字就是開放的埠號。
『Foreign Address』代表遠端地址,如果和其他機器正在連線,顯示的就是對方的位址。
『State』代表狀態,如果顯示LISTENING表示處於偵聽狀態,就是說該埠是開放的,等待連接,但還沒有被連接。
『PID』代表連線程式的 PID(Process ID)。

 在連線時『State』可能會有以下幾種狀態:
   LISTENING:偵聽狀態,等待連接。
   SYN_SENT:連線初始時,發送封包的狀態。
   SYN_RECV:接收到一個要求連線的主動連線封包。
   TIME_WAIT:等候對方回應的狀態。
   ESTABLISHED:連線已建立完成的狀態。
   FIN_WAIT1:該插槽服務(socket)已中斷,該連線正在斷線當中。 
   FIN_WAIT2:該連線已掛斷,但正在等待對方主機回應斷線確認的封包。

Reference : 找出開啟網路連線的程式(高醫大)

How to run RSoP to determine computer and user policy settings

You must be a local administrator on the local computer for RsoP to return the computer configuration policy settings.
Step 1: Run rsop.msc from a local computer










Rsop will run and generate a report for the user and computer policy settings.

















Or... On your command line Run "gpresult /H D:\GPO.html"