domingo, 4 de junio de 2023

Command to see all certificates in windows

 dir cert:\LocalMachine\my | Where-Object { $_.HasPrivateKey } | Foreach-Object { write-host $_.thumbprint - $_.subject }


lunes, 24 de abril de 2023

Script to disable a user account on AD, AAD, Exchange

 [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Install-Module -Name AzureAD

Install-Module -Name ExchangeOnlineManagement

Import-Module  AzureAD

Import-Module ActiveDirectory

$msgWelcome = "Script to disable an user account of AD and AAD Services..."

$msgInitProcessAzure = "Connecting to Azure AD..."

$msgInitProcessExchange = "Connecting to Exchange Online..."

$msgInitProcessActiveDirectory = "Connecting to Active Directory..."

$msgInitProcessSyncAAD = "Syncing Azure AD..."

$msgInitProcessRemoveAAD = "Removing group membership of Azure AD..."

$msgInitProcessRenameAndMove = "Renaming and moving the AD's username..."

$msgFinish = "The process is finished..."

$name = ""

$surname = ""

$username = ""

$email = ""

$parameterRename = "z_archive"



$msgWelcome

$name = Read-Host 'Enter the name of the user (For example James)'

$surname = Read-Host 'Enter the surname of the user (For example )'

$username = Read-Host 'Enter the username (For example James)'

$email = Read-Host 'Enter the email (For example james@)'


$msgInitProcessAzure

Connect-AzureAD

Set-AzureADUser -ObjectID $email -AccountEnabled $false


$msgInitProcessExchange

Connect-ExchangeOnline

Set-Mailbox -Identity $email -Type Shared


$msgInitProcessActiveDirectory

Disable-ADAccount -Identity $username

$adGroupsOfUser = Get-ADPrincipalGroupMembership -Identity  $username | where {$_.Name -ne “Domain Users”}

# Removing group membership.

Remove-ADPrincipalGroupMembership -Identity  $username -MemberOf $adGroupsOfUser -Confirm:$false -verbose


$msgInitProcessSyncAAD

Invoke-Command MK-AZUREAD-W19V -Credential BWSRVR.CORP\AdXXX { Start-ADSyncSyncCycle -PolicyType Delta }

Start-Sleep -Seconds 60


$msgInitProcessRemoveAAD

$aadUser = Get-AzureADUser -ObjectId $email

$aadGroupsOfUser = Get-AzureADUserMembership -ObjectId $email | where {$_.DisplayName -ne “All Users”}

foreach($group in $aadGroupsOfUser.ObjectId){

    Remove-AzureADGroupMember -ObjectId $group -MemberId $aadUser.ObjectId

}


$msgInitProcessRenameAndMove

Set-ADUser -Identity $username -DisplayName "z_archive $name $surname" -EmailAddress "z_archive.$email" -UserPrincipalName "z_archive.$username"  -SamAccountName "z_archive.$name"

Get-ADUser "z_archive.$name"| Move-ADObject -TargetPath 'OU=Archived Mailboxes,OU=Users,OU=SIT,DC=B,DC=CORP'

Get-ADUser "z_archive.$name"| Rename-ADObject -NewName "z_archive $name $surname"


$msgFinish

jueves, 13 de abril de 2023

How to install DAX 2009 script

 start /wait C:\Dax\DynamicsAX2009\setup.exe LogDir=C:\Dax HideUI=1 AcceptLicenseTerms=1 BypassWarnings=0 RunMode=Custom InstallClientUI=1 ConfigurePrerequisites=1 InstallPath="C:\Program Files\Microsoft Dynamics AX\50" InstallPath32Bit="C:\Program Files (x86)\Microsoft Dynamics AX\50" ClientLanguage=EN-AU ClientHelpLanguages=EN-AU ClientAosServer=Axapta AosInstanceName= AosPort=2712 InstallNetBusinessConnector=1


start /wait C:\Dax\DynamicsAX2009SP1\axupdate.exe LogDir=C:\Dax HideUI=1 AcceptLicenseTerms=1 InstallComponents=1 SetupLanguage=EN InstallPath="C:\Program Files\Microsoft Dynamics AX\50" InstallPath32Bit="C:\Program Files (x86)\Microsoft Dynamics AX\50"


start /wait C:\Dax\SQLServerClientTools\SQLSysClrTypes\SQLSysClrTypes2012_x64.msi /qn /l* "%temp%\MicrosoftSystemCLRTypesforSQLServer2012_x64.txt" /norestart ALLUSERS=2


start /wait C:\Dax\SQLServerClientTools\MicrosoftReportViewer\ReportViewer2005.exe /Q /C:"install.exe /q /l ""%temp%\MicrosoftReportViewerRedistributable2005.txt"""


start /wait C:\Dax\SQLServerClientTools\MicrosoftReportViewer\ReportViewer2008SP1.exe /q /l "%temp%\MicrosoftReportViewerRedistributable2008SP1.txt"


start /wait C:\Dax\SQLServerClientTools\MicrosoftReportViewer\ReportViewer2010SP1.exe /q /norestart /log "%temp%\MicrosoftReportViewer2010SP1.txt"


start /wait C:\Dax\SQLServerClientTools\MicrosoftReportViewer\ReportViewer2012.msi /qn /l* "%temp%\MicrosoftReportViewer2012.txt" /norestart ALLUSERS=2

jueves, 23 de marzo de 2023

New vulnerability on Outlook

 



Check on the DC server the logs:

<QueryList>

  <Query Id="0" Path="Security">

    <Select Path="Security">

*[System[(EventID=4624)]]

and

*[EventData[Data[@Name='AuthenticationPackageName']='NTLM']]

and

*[EventData[Data[@Name='TargetUserName']!='ANONYMOUS LOGON']]

</Select>

  </Query>

</QueryList>



How to Disable NTLM Authentication in Windows Domain? | Windows OS Hub (woshub.com)



martes, 21 de marzo de 2023

How to connect to exchange online

Set-ExecutionPolicy -ExecutionPolicy Unrestricted

Get-ExecutionPolicy

Connect-ExchangeOnline -UserPrincipalName alejandro.garcia@birchandwaite.com.au

Get-AcceptedDomain

Disconnect-ExchangeOnline

jueves, 16 de marzo de 2023

How to filter security logs of active directory by username

 How to filter security logs of active directory by username

<QueryList>

  <Query Id="0" Path="Security">

    <Select Path="Security">*[

 EventData[Data[@Name='TargetUserName']='DataDevice1']]</Select>

  </Query>

</QueryList>

viernes, 20 de enero de 2023

Windows 7 language packs

 

Download Official 32-bit (x86) Windows 7 SP1 Language Packs (MUI)

Arabic:
windows6.1-kb2483139-x86-ar-sa_5add6e4a36127029d431ba98d99708c44ef9b53f.exe
Bulgarian:
windows6.1-kb2483139-x86-bg-bg_a8a5013e477366119cfdc5fbda43b904755db450.exe
Chinese (Simplified):
windows6.1-kb2483139-x86-zh-cn_ae61ea226215f96fc95be33201ffc96755ac7eb5.exe
Chinese (Traditional):
windows6.1-kb2483139-x86-zh-hk_411a6bb68728f12f5ced712d9a33fee9ebe0b0b3.exe
Croatian:
windows6.1-kb2483139-x86-hr-hr_685e217ce007af8005db4726087893d04e19dade.exe
Czech:
windows6.1-kb2483139-x86-cs-cz_bb5061f4bd24437dd31a3714e1b54318ced7e63a.exe
Danish:
windows6.1-kb2483139-x86-da-dk_67fecaab0a940e2e537bc8dcd8a9ebb8ab4ed102.exe
Dutch:
windows6.1-kb2483139-x86-nl-nl_b7e1c3046b218fb45a665ab5f5ed8a5ea8125760.exe
English:
windows6.1-kb2483139-x86-en-us_783d6dd59e2ec8fb0995a059c9c121795bde46c8.exe
Estonian:
windows6.1-kb2483139-x86-et-ee_d0f798de315b696bf560b559f6f90064687c0b7b.exe
Finnish:
windows6.1-kb2483139-x86-fi-fi_5259ca6a22a981dbdee352dde5b8e65c2fddd407.exe
French:
windows6.1-kb2483139-x86-fr-fr_f57427487dfc2f49da67cac22480ab1f48983d22.exe
German:
windows6.1-kb2483139-x86-de-de_acb9b88b96d432749ab63bd93423af054d23bf81.exe
Greek:
windows6.1-kb2483139-x86-el-gr_5aeecda7e1d689a083975128901da8156751dfc5.exe
Hebrew:
windows6.1-kb2483139-x86-he-il_1849d14777a76c7c5b4ef766490dccc8aed5c56b.exe
Hungarian:
windows6.1-kb2483139-x86-hu-hu_a7a5af62c59ab7a4e8cb0f21242b42606b95195b.exe
Italian:
windows6.1-kb2483139-x86-it-it_1d54a8d0047674fc1b5b6f41292a0074d9fe3cc5.exe


Japanese:
windows6.1-kb2483139-x86-ja-jp_bc46078938ae9129c7ce86a9c176fa517e4c0a3d.exe
Korean:
windows6.1-kb2483139-x86-ko-kr_18f213428cc6fde96d8c76c6dd91446348e86ce6.exe
Latvian:
windows6.1-kb2483139-x86-lv-lv_97b58149699a2e8b02bd7cac720ac0795b51c98b.exe
Lithuanian:
windows6.1-kb2483139-x86-lt-lt_297c5ee6e98ab646b14f1492716b67cc0970fcd8.exe
Norwegian:
windows6.1-kb2483139-x86-nb-no_5bd6fc76ad54b7a232d4ceb4a5f5c7c366bf90b6.exe
Polish:
windows6.1-kb2483139-x86-pl-pl_c460a8c1392d7f3d35d1c0b37e56017d3552d245.exe
Portuguese (Brazil):
windows6.1-kb2483139-x86-pt-br_6e1d337b2fd56669d461e82601aa51004fecbd24.exe
Portuguese (Portugal):
windows6.1-kb2483139-x86-pt-pt_5cc92ef98ed177b2f6bbae3a0420ee2f12764fab.exe
Romanian:
windows6.1-kb2483139-x86-ro-ro_d8d9b2b4c5c457fe6a7dcb09a5f645cfe77cc30c.exe
Russian:
windows6.1-kb2483139-x86-ru-ru_6532a8f36ad7d15277d5d60da92555f0fbee4daa.exe
Serbian (Latin):
windows6.1-kb2483139-x86-sr-latn-cs_e3d9acfcc9f608cf7687bd3b5ee7f0d9658b7bc9.exe


Slovak:
windows6.1-kb2483139-x86-sk-sk_4c7b17a6cb292b09bede4c8731ad4f24cd09ab2a.exe
Slovenian:
windows6.1-kb2483139-x86-sl-si_de7f366819e1c12954557e3e65b7c0f059f49b67.exe
Spanish:
windows6.1-kb2483139-x86-es-es_6aef75f7d83edaabc2a921a6b157cc7005628286.exe
Swedish:
windows6.1-kb2483139-x86-sv-se_bd65af75e8995bd865d93c8d8c8a35091499083f.exe
Thai:
windows6.1-kb2483139-x86-th-th_8248f2b209d65a39ddaeb36e1782fcc0f6664f73.exe
Turkish:
windows6.1-kb2483139-x86-tr-tr_228dfa5fbaa4606b17f93d6fcd51c8c85c0f1fd3.exe
Ukrainian:
windows6.1-kb2483139-x86-uk-ua_7f01db99ad2b2d41598bfc71aaa9bd4be04b6369.exe

Download Official 64-bit (x64) Windows 7 SP1 Language Packs (MUI)

Arabic:
windows6.1-kb2483139-x64-ar-sa_f07f2cc7b55b17076eebceea2c2c2826b08b8f63.exe
Bulgarian:
windows6.1-kb2483139-x64-bg-bg_e4c9392592ed2d4a8c7ec68270b5140430df197a.exe
Chinese (Simplified):
windows6.1-kb2483139-x64-zh-cn_2c1884b4fdf6c8e91986369d88bbcaae01c6f187.exe
Chinese (Traditional):
windows6.1-kb2483139-x64-zh-hk_285282b1e2f750eeed91466918443b657968d977.exe
Croatian:
windows6.1-kb2483139-x64-hr-hr_e7c6d648436d81466af331ab1ece07dd22be5fda.exe
Czech:
windows6.1-kb2483139-x64-cs-cz_1ea5b71d701e2480017b464b6560a2987e0d8971.exe
Danish:
windows6.1-kb2483139-x64-da-dk_d753d19cc1a0fe95aef21548193393c04a6a8024.exe
Dutch:
windows6.1-kb2483139-x64-nl-nl_12c90c70d408b08f51f500d6e974878a5d662398.exe
English:
windows6.1-kb2483139-x64-en-us_9b9c8a867baff2920507fbf1e1b4a158572b9b87.exe
Estonian:
windows6.1-kb2483139-x64-et-ee_b4fd94f6e461e21b7eec54d1e379e2807861aea2.exe
Finnish:
windows6.1-kb2483139-x64-fi-fi_223465e1b382484d1d82f8f2ccfcd9ed2f902c76.exe


French:
windows6.1-kb2483139-x64-fr-fr_0f18e2a244dd9ff04664112a82776d2bd2177798.exe
German:
windows6.1-kb2483139-x64-de-de_4f4ce6bd38530b4a02199172863b21a0cba13773.exe
Greek:
windows6.1-kb2483139-x64-el-gr_583791fea2fea71725388a746844d5be6488ca45.exe
Hebrew:
windows6.1-kb2483139-x64-he-il_617029400059f0847d7d90d4da673ae4ed43ebd9.exe
Hungarian:
windows6.1-kb2483139-x64-hu-hu_1c298d99baf7af3d830dcd1e2632eeb65d7ee395.exe
Italian:
windows6.1-kb2483139-x64-it-it_6d8223c065d6974d833d0eaa162f3ceb7680850f.exe
Japanese:
windows6.1-kb2483139-x64-ja-jp_aeaf7e9b0b6c2173bf757330017a7f655f1f8715.exe
Korean:
windows6.1-kb2483139-x64-ko-kr_0ea76f748e3d5309d568147ad1337b2664090944.exe
Latvian:
windows6.1-kb2483139-x64-lv-lv_3919fb044a307144f1fc55cf4313aff45cde9a46.exe
Lithuanian:
windows6.1-kb2483139-x64-lt-lt_c894f0a591735553ba68f9fb94b1b85133ca922c.exe
Norwegian:
windows6.1-kb2483139-x64-nb-no_78df68604970041a6337b4058a3e5339f79e50b4.exe
Polish:
windows6.1-kb2483139-x64-pl-pl_24d00a966a7a75132c3af5627634483d3e2d01e7.exe
Portuguese (Brazil):
windows6.1-kb2483139-x64-pt-br_f8035731c55d774c95c7c673aedfd42d52479294.exe


Portuguese (Portugal):
windows6.1-kb2483139-x64-pt-pt_78485491088298110a3e78b7a5f95e55ff7808df.exe
Romanian:
windows6.1-kb2483139-x64-ro-ro_6e7a63541f2cb534dab3db719330fee5cfbb4e0f.exe
Russian:
windows6.1-kb2483139-x64-ru-ru_0587eb296a2f04e0d3699650d39b53ee18b97a79.exe
Serbian (Latin):
windows6.1-kb2483139-x64-sr-latn-cs_5f487007933585def54c67087895e74e25e699a9.exe
Slovak:
windows6.1-kb2483139-x64-sk-sk_f1fb8a395d7d656649830f4f06496a5311ad572a.exe
Slovenian:
windows6.1-kb2483139-x64-sl-si_84606ed6bc061c72f756bbc061621b490fb761f7.exe
Spanish:
windows6.1-kb2483139-x64-es-es_fdbdf4061b960324efb9eedf7106df543ed8ce33.exe
Swedish:
windows6.1-kb2483139-x64-sv-se_81051fe3083afdb4f2d1d23752c587de9bb35025.exe
Thai:
windows6.1-kb2483139-x64-th-th_dc9c0cc12ae488ed3e8dcaecb4392eef91ec213b.exe
Turkish:
windows6.1-kb2483139-x64-tr-tr_07e7e3b34426fe68be813e911d3843b941a268b7.exe
Ukrainian:
windows6.1-kb2483139-x64-uk-ua_1ca449545a2bcfdeeed6080768186fc29f163504.exe