<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tricks, Tips and Fixes &#8211; achraf ben alaya</title>
	<atom:link href="https://achrafbenalaya.com/category/blog/tricks-tips-and-fixes/feed/" rel="self" type="application/rss+xml" />
	<link>https://achrafbenalaya.com</link>
	<description>Tech Blog By Achraf Ben Alaya</description>
	<lastBuildDate>Mon, 05 Aug 2024 10:10:44 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.5</generator>

<image>
	<url>/wp-content/uploads/2022/02/cropped-me-scaled-1-32x32.jpeg</url>
	<title>Tricks, Tips and Fixes &#8211; achraf ben alaya</title>
	<link>https://achrafbenalaya.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">189072172</site>	<item>
		<title>Dealing with Stuck &#8216;Signing Out&#8217; Screens on Azure Windows Servers</title>
		<link>https://achrafbenalaya.com/2024/08/02/dealing-with-stuck-signing-out-screens-on-azure-windows-servers/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dealing-with-stuck-signing-out-screens-on-azure-windows-servers</link>
					<comments>https://achrafbenalaya.com/2024/08/02/dealing-with-stuck-signing-out-screens-on-azure-windows-servers/#respond</comments>
		
		<dc:creator><![CDATA[achraf]]></dc:creator>
		<pubDate>Fri, 02 Aug 2024 14:46:38 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Tricks, Tips and Fixes]]></category>
		<guid isPermaLink="false">https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/?p=1950</guid>

					<description><![CDATA[In this article, we&#8217;ll explore effective solutions for addressing a common issue encountered with Windows servers on Microsoft Azure: sessions getting stuck on the &#8220;Signing Out&#8221; screen. We will provide step-by-step instructions on how to resolve this problem without the need to reboot the virtual machine, ensuring minimal disruption and maintaining server availability. Our guide [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this article, we&#8217;ll explore effective solutions for addressing a common issue encountered with Windows servers on Microsoft Azure: sessions getting stuck on the &#8220;Signing Out&#8221; screen. We will provide step-by-step instructions on how to resolve this problem without the need to reboot the virtual machine, ensuring minimal disruption and maintaining server availability. Our guide is designed to help you quickly regain access and functionality, even when traditional methods fail.</p>
<h2>Solution</h2>
<p>Prerequisites : Boot diagnostics must be enabled for the instance  .</p>
<ol>
<li><strong>Accessing Windows Server Serial console:</strong><br />
<a href="https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/wp-content/uploads/2024/07/blockedsing1.png"><img fetchpriority="high" decoding="async" class="aligncenter size-full wp-image-1957" src="https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/wp-content/uploads/2024/07/blockedsing1.png" alt="" width="1261" height="1056" srcset="/wp-content/uploads/2024/07/blockedsing1.png 1261w, /wp-content/uploads/2024/07/blockedsing1-300x251.png 300w, /wp-content/uploads/2024/07/blockedsing1-1024x858.png 1024w, /wp-content/uploads/2024/07/blockedsing1-768x643.png 768w, /wp-content/uploads/2024/07/blockedsing1-750x628.png 750w, /wp-content/uploads/2024/07/blockedsing1-1140x955.png 1140w" sizes="(max-width: 1261px) 100vw, 1261px" /></a></li>
<li><strong> Once the console is connected, you will get the SAC prompt.</strong>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">```
Computer is booting, SAC started and initialized.
Use the "ch -?" command for information about using channels.
Use the "?" command for general help.

```</pre>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">```
SAC&gt;
EVENT: The CMD command is now available.
SAC&gt;

```</pre>
</li>
<li><strong>Type “cmd” to create the to the server console channel.</strong>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">SAC&gt;cmd
The Command Prompt session was successfully launched.
SAC&gt;
EVENT:   A new channel has been created.  Use "ch -?" for channel help.
Channel: Cmd0001
SAC&gt;</pre>
</li>
<li><strong>Use the channel number to connect to the instance console. Use command “ch -si 1” and press Enter.</strong>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">SAC&gt; ch -si 1
 Name:                  Cmd0001
 Description:           Command
 Type:                  VT-UTF8
 Channel GUID:          e7f52da4-203b-11ea-a80f-000d3a7b44b4
 Application Type GUID: 63d02271-8aa4-11d5-bccf-00b0d014a2d0
 Press  for next channel.
 Press 0 to return to the SAC channel.
 Use any other key to view this channel.</pre>
<p>&nbsp;</li>
<li><strong>Enter the windows instance user credentials to access windows command prompt.</strong>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">Please enter login credentials.
Username: lingesh
Domain  :
Password:</pre>
<p>&nbsp;</li>
<li><strong>Once you have authenticated successfully, you will get windows command prompt like below.</strong><a href="https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/wp-content/uploads/2024/07/Items.png"><img decoding="async" class="aligncenter size-full wp-image-1958" src="https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/wp-content/uploads/2024/07/Items.png" alt="" width="677" height="73" srcset="/wp-content/uploads/2024/07/Items.png 677w, /wp-content/uploads/2024/07/Items-300x32.png 300w" sizes="(max-width: 677px) 100vw, 677px" /></a></li>
<li><strong>Run the Command to See Connected Users</strong>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">query user</pre>
<p><a href="https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/wp-content/uploads/2024/08/Items-1.png"><img decoding="async" class="aligncenter size-full wp-image-1959" src="https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/wp-content/uploads/2024/08/Items-1.png" alt="" width="712" height="218" srcset="/wp-content/uploads/2024/08/Items-1.png 712w, /wp-content/uploads/2024/08/Items-1-300x92.png 300w" sizes="(max-width: 712px) 100vw, 712px" /></a></li>
<li><strong>Log off the stuck session:</strong>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">logoff &lt;session_id&gt;</pre>
<p>Example : logoff  4</p>
<p>And like that when you try again to connect to  RDP , you will find that the issue is resolved .</li>
</ol>
]]></content:encoded>
					
					<wfw:commentRss>https://achrafbenalaya.com/2024/08/02/dealing-with-stuck-signing-out-screens-on-azure-windows-servers/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1950</post-id>	</item>
		<item>
		<title>Generating report for SSL Certificates for Websites with PowerShell</title>
		<link>https://achrafbenalaya.com/2022/04/09/generating-report-for-ssl-certificates-for-websites-with-powershell/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=generating-report-for-ssl-certificates-for-websites-with-powershell</link>
					<comments>https://achrafbenalaya.com/2022/04/09/generating-report-for-ssl-certificates-for-websites-with-powershell/#respond</comments>
		
		<dc:creator><![CDATA[achraf]]></dc:creator>
		<pubDate>Sat, 09 Apr 2022 22:11:19 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Tricks, Tips and Fixes]]></category>
		<guid isPermaLink="false">https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/?p=1435</guid>

					<description><![CDATA[One of the most common problems that our teams deal with is ensuring that SSL certificates are up-to update and working correctly for more than 350 websites. Dealing with a lot of work, production and incidents will not allow us to analyze each website and verify it, and we must make sure all websites are up/secure and running and we [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>One of the most common problems that our teams deal with is ensuring that SSL certificates are up-to update and working correctly for more than 350 websites.</p>
<p>Dealing with a lot of work, production and incidents will not allow us to analyze each website and verify it, and we must make sure all websites are up/secure and running and we do not want to have an accident caused by an expired certificate.</p>
<p>More than that, we have some websites under a private azure application gateway and others using public application gateways, we also have some websites Secured by WAF (Web Application Firewall) so we wanted to identify and organize that in an excel file that will contain all the info&#8217;s and we can share that with all the team members.</p>
<p>By that, we can have  a full view of all our websites, and we can prevent such accidents by having tasks that run daily and testing all the SSL endpoints that we have, and sending a report about The certification expiration info,<br />
under Application Gateway or not (private or public), secured WAF or not &#8230; this info will not only help us to verify the SSL end day but also understand what we have in our environment, and if we have a problem we go directly there.</p>
<p>For that, I ended up writing this PowerShell script that will generate a csv file and we will test it on my website</p>
<pre class="EnlighterJSRAW" data-enlighter-language="powershell">param(
  [Parameter(Mandatory = $False, Position = 0, ValueFromPipeline = $false)]
  [System.Int32]
  $minimumCertAgeDays = 30
)

#get the list of links to scan
$NameList = get-content C:\ssl\SSLDEMO\urls.txt 
$Results = @()

#SSL variables
#$minimumCertAgeDays = 60
$timeoutMilliseconds = 15000
#disabling the cert validation check. This is what makes this whole thing work with invalid certs...
[Net.ServicePointManager]::ServerCertificateValidationCallback = { $true }


foreach ($Name in $NameList) {
  $OutputObject = "" | Select-Object Type, OriginUrl, Name,Hostnames,Gateway, IPAddress, Status, SSLStartDAY, SSLENDDAY, SSENDINDAYS, StatusSSLMinAge, ErrorMessage 
  try {        
 
    $domain = ([System.URI]$Name).host.Trim()
    $dnsRecord = Resolve-DnsName $domain            
    $OutputObject.Name = $($dnsRecord.Name -join ',')
    $OutputObject.OriginUrl = $Name
    $OutputObject.Type = $($dnsRecord.Type -join ',')
    $OutputObject.IPAddress = ($dnsRecord.IPAddress -join ',')
    switch ($dnsRecord.IPAddress)
                        {                            
                            $ipGatewayOne
                            {
                               $OutputObject.Gateway = 'Gateway1'
                            }
                           
                            #Default state
                            Default
                            {
                                 $OutputObject.Gateway = ''
                            }
                        }     
    $OutputObject.Status = 'OK'     
    $OutputObject.ErrorMessage = ''    
    $OutputObject.Hostnames=($dnsRecord.NameHost -join ',')     
    #SSL STUFF
    Write-Host Checking $Name -f Green
    $req = [Net.HttpWebRequest]::Create($Name)
    $req.Timeout = $timeoutMilliseconds
    $req.AllowAutoRedirect = $true
    try {
      $req.GetResponse() | Out-Null
    } 
    catch {
             
      Write-Host Exception while checking URL $Name`: $_ -f Red
    }

    $certExpiresOnString = $req.ServicePoint.Certificate.GetExpirationDateString()
    #Write-Host "Certificate expires on (string): $certExpiresOnString"
    [datetime]$expiration = [System.DateTime]::Parse($req.ServicePoint.Certificate.GetExpirationDateString())
    #Write-Host "Certificate expires on (datetime): $expiration"
    [int]$certExpiresIn = ($expiration - $(get-date)).Days
    $certName = $req.ServicePoint.Certificate.GetName()
    $certPublicKeyString = $req.ServicePoint.Certificate.GetPublicKeyString()
    $certSerialNumber = $req.ServicePoint.Certificate.GetSerialNumberString()
    $certThumbprint = $req.ServicePoint.Certificate.GetCertHashString()
    $certEffectiveDate = $req.ServicePoint.Certificate.GetEffectiveDateString()
    $certIssuer = $req.ServicePoint.Certificate.GetIssuerName()
    $OutputObject.SSLStartDAY = $certEffectiveDate 
    $OutputObject.SSLENDDAY = $expiration
    $OutputObject.SSENDINDAYS = $certExpiresIn 

    if ($certExpiresIn -gt $minimumCertAgeDays)
    {   
      Write-Host Cert for site $Name expires in $certExpiresIn days [on $expiration] -f Green  
      $OutputObject.StatusSSLMinAge = 'ok'    

    }
    else {
      
      Write-Host WARNING: Cert for site $Name expires in $certExpiresIn days [on $expiration] -f Red
      $OutputObject.StatusSSLMinAge = 'ko'    

    }


    #END SSL STUFF

  }  

  catch {      
    $OutputObject.Name = $Name       
    $OutputObject.IPAddress = ''       
    $OutputObject.Status = 'NOT_OK'     
    $OutputObject.ErrorMessage = $_.Exception.Message  
  }   

    $Results += $OutputObject
                
}
              
return $Results | Export-Csv C:\ssl\SSLDEMO\sslresultsnew.csv -NoTypeInformation

</pre>
<p>Results in Powershell :</p>
<p><a href="https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/wp-content/uploads/2022/04/sslpowershell.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1439" src="https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/wp-content/uploads/2022/04/sslpowershell.png" alt="" width="1265" height="595" srcset="/wp-content/uploads/2022/04/sslpowershell.png 1265w, /wp-content/uploads/2022/04/sslpowershell-300x141.png 300w, /wp-content/uploads/2022/04/sslpowershell-1024x482.png 1024w, /wp-content/uploads/2022/04/sslpowershell-768x361.png 768w, /wp-content/uploads/2022/04/sslpowershell-750x353.png 750w, /wp-content/uploads/2022/04/sslpowershell-1140x536.png 1140w" sizes="(max-width: 1265px) 100vw, 1265px" /></a><a href="https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/wp-content/uploads/2022/04/resultexxcel-1.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1441" src="https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/wp-content/uploads/2022/04/resultexxcel-1.png" alt="" width="1241" height="283" srcset="/wp-content/uploads/2022/04/resultexxcel-1.png 1241w, /wp-content/uploads/2022/04/resultexxcel-1-300x68.png 300w, /wp-content/uploads/2022/04/resultexxcel-1-1024x234.png 1024w, /wp-content/uploads/2022/04/resultexxcel-1-768x175.png 768w, /wp-content/uploads/2022/04/resultexxcel-1-750x171.png 750w, /wp-content/uploads/2022/04/resultexxcel-1-1140x260.png 1140w" sizes="(max-width: 1241px) 100vw, 1241px" /></a>Now I have tested this code with more than 400 URLs together.</p>
<p>All you have to do is to point to a text file that contains the URLs starting with: https://<br />
Also, in the application gateway, we can manage the renewal of SSL certificate, and I will share a post about this asap.<br />
I hope you enjoy this article</p>
]]></content:encoded>
					
					<wfw:commentRss>https://achrafbenalaya.com/2022/04/09/generating-report-for-ssl-certificates-for-websites-with-powershell/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1435</post-id>	</item>
		<item>
		<title>Tools I use with Database</title>
		<link>https://achrafbenalaya.com/2021/11/07/tools-i-use-with-database/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=tools-i-use-with-database</link>
					<comments>https://achrafbenalaya.com/2021/11/07/tools-i-use-with-database/#respond</comments>
		
		<dc:creator><![CDATA[achraf]]></dc:creator>
		<pubDate>Sun, 07 Nov 2021 11:38:33 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[Tricks, Tips and Fixes]]></category>
		<guid isPermaLink="false">https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/?p=1371</guid>

					<description><![CDATA[If you work a lot with  database/tables and you start working on a project that is ongoing and there is already a tons of tables that exists you may get wasted. In all the projects I worked on I have used SQL server, recently I worked on a project that uses Postgresql, and there was [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>If you work a lot with  database/tables and you start working on a project that is ongoing and there is already a tons of tables that exists you may get wasted.<br />
<img decoding="async" class="aligncenter" src="https://c.tenor.com/jlHAbfAnlVkAAAAC/get-the-tables-dudley-boys.gif" alt="D Von Get The Tables GIFs | Tenor" /></p>
<p>In all the projects I worked on I have used SQL server, recently I worked on a project that uses Postgresql, and there was like a thousand table and I&#8217;m completely lost trying out to understand the schema, the relation between the tables, and where I can find my data, it was really exhausting figuring out the relation between certain tables and for that, I was looking for a tool that can help me/us and there were a few suggestions by the team members that I wanted to share with you.</p>
<h2>Pgadmin :</h2>
<p>&nbsp;</p>
<p>PGAdmin is a web-based GUI tool <b>used to interact with the Postgres database sessions</b>, both locally and remote servers as well. You can use PGAdmin to perform any sort of database administration required for a Postgres database.</p>
<p><img decoding="async" src="https://www.dsfc.net/wp-content/uploads/2017/09/pgadmin-4-dashboard.jpg" alt="Baisser l&amp;#39;impact de l&amp;#39;utilisation de PgAdmin 4 sur PostgreSQL" /></p>
<h2>Azure Data Studio</h2>
<p>Azure Data Studio is <b>a cross-platform database tool for data professionals using on-premises and cloud data platforms</b> on Windows, macOS, and Linux. Azure Data Studio offers a modern editor experience with IntelliSense, code snippets, source control integration, and an integrated terminal.</p>
<h2><a href="https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/wp-content/uploads/2021/11/aztablest.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1373" src="https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/wp-content/uploads/2021/11/aztablest.png" alt="" width="1316" height="672" srcset="/wp-content/uploads/2021/11/aztablest.png 1316w, /wp-content/uploads/2021/11/aztablest-300x153.png 300w, /wp-content/uploads/2021/11/aztablest-1024x523.png 1024w, /wp-content/uploads/2021/11/aztablest-768x392.png 768w, /wp-content/uploads/2021/11/aztablest-750x383.png 750w, /wp-content/uploads/2021/11/aztablest-1140x582.png 1140w" sizes="(max-width: 1316px) 100vw, 1316px" /></a>DBeaver</h2>
<p>DBeaver is a <b>free, open source multiplatform database management tool and SQL client for developers and database administrators</b>. DBeaver can be used to access any database or cloud application that has an ODBC or JDBC driver, such as Oracle, SQL Server, MySQl, Salesforce, or MailChimp.</p>
<p>For me , this is the most awesome tool to connect and see your tables and  diagrams and let me show you why :</p>
<p><a href="https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/wp-content/uploads/2021/11/dbeaver.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1374" src="https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/wp-content/uploads/2021/11/dbeaver.png" alt="" width="1892" height="1054" srcset="/wp-content/uploads/2021/11/dbeaver.png 1892w, /wp-content/uploads/2021/11/dbeaver-300x167.png 300w, /wp-content/uploads/2021/11/dbeaver-1024x570.png 1024w, /wp-content/uploads/2021/11/dbeaver-768x428.png 768w, /wp-content/uploads/2021/11/dbeaver-1536x856.png 1536w, /wp-content/uploads/2021/11/dbeaver-750x418.png 750w, /wp-content/uploads/2021/11/dbeaver-1140x635.png 1140w" sizes="(max-width: 1892px) 100vw, 1892px" /></a></p>
<p><a href="https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/wp-content/uploads/2021/11/dbev.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1375" src="https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/wp-content/uploads/2021/11/dbev.png" alt="" width="1900" height="904" srcset="/wp-content/uploads/2021/11/dbev.png 1900w, /wp-content/uploads/2021/11/dbev-300x143.png 300w, /wp-content/uploads/2021/11/dbev-1024x487.png 1024w, /wp-content/uploads/2021/11/dbev-768x365.png 768w, /wp-content/uploads/2021/11/dbev-1536x731.png 1536w, /wp-content/uploads/2021/11/dbev-750x357.png 750w, /wp-content/uploads/2021/11/dbev-1140x542.png 1140w" sizes="(max-width: 1900px) 100vw, 1900px" /></a></p>
<h2 data-xid="Download LINQPad">LINQPad</h2>
<p>LINQPad is a software utility targeted at . NET Framework and . NET Core development. It is used to <b>interactively query SQL databases</b> (among other data sources such as OData or WCF Data Services) using LINQ, as well as interactively writing C# code without the need for an IDE.</p>
<p><a href="https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/wp-content/uploads/2021/11/linqpad.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1376" src="https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/wp-content/uploads/2021/11/linqpad.png" alt="" width="834" height="462" srcset="/wp-content/uploads/2021/11/linqpad.png 834w, /wp-content/uploads/2021/11/linqpad-300x166.png 300w, /wp-content/uploads/2021/11/linqpad-768x425.png 768w, /wp-content/uploads/2021/11/linqpad-750x415.png 750w" sizes="(max-width: 834px) 100vw, 834px" /></a> <a href="https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/wp-content/uploads/2021/11/linqpad2.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1377" src="https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/wp-content/uploads/2021/11/linqpad2.png" alt="" width="793" height="357" srcset="/wp-content/uploads/2021/11/linqpad2.png 793w, /wp-content/uploads/2021/11/linqpad2-300x135.png 300w, /wp-content/uploads/2021/11/linqpad2-768x346.png 768w, /wp-content/uploads/2021/11/linqpad2-750x338.png 750w" sizes="(max-width: 793px) 100vw, 793px" /></a></p>
<h2>SQL management studio</h2>
<p><a href="https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/wp-content/uploads/2021/11/sqlma.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-1378" src="https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/wp-content/uploads/2021/11/sqlma.png" alt="" width="1900" height="904" srcset="/wp-content/uploads/2021/11/sqlma.png 1900w, /wp-content/uploads/2021/11/sqlma-300x143.png 300w, /wp-content/uploads/2021/11/sqlma-1024x487.png 1024w, /wp-content/uploads/2021/11/sqlma-768x365.png 768w, /wp-content/uploads/2021/11/sqlma-1536x731.png 1536w, /wp-content/uploads/2021/11/sqlma-750x357.png 750w, /wp-content/uploads/2021/11/sqlma-1140x542.png 1140w" sizes="(max-width: 1900px) 100vw, 1900px" /></a>Well, those were a couple of tools I used and I have been using, and hope this was helpful for you.</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://achrafbenalaya.com/2021/11/07/tools-i-use-with-database/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1371</post-id>	</item>
		<item>
		<title>405 method not allowed in IIS</title>
		<link>https://achrafbenalaya.com/2020/10/17/405-method-not-allowed-in-iis/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=405-method-not-allowed-in-iis</link>
					<comments>https://achrafbenalaya.com/2020/10/17/405-method-not-allowed-in-iis/#respond</comments>
		
		<dc:creator><![CDATA[achraf]]></dc:creator>
		<pubDate>Sat, 17 Oct 2020 13:03:28 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Tricks, Tips and Fixes]]></category>
		<guid isPermaLink="false">https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/?p=848</guid>

					<description><![CDATA[Recently , I was delivering a project for a client , and usually what I do is , I prepare CI/CD pipelines , I test the project and I deliver it . That worked fine , but this time , the client wants the project to be hosted on his own virtual machine , no [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Recently , I was delivering a project for a client , and usually what I do is , I prepare CI/CD pipelines , I test the project and I deliver it .</p>
<p>That worked fine , but this time , the client wants the project to be hosted on his own virtual machine , no problem with that let me do it ,it will take 15 min and  later I can go  jogging or maybe watch an episode of Gotham and see what will happen to Bruce! .</p>
<p>I published the project to a folder , launched IIS ,added a new site and hosted it ,good , let  me test !</p>
<p>I tested the create and get methods ,they worked , and the lesson that I learned in my earlier job is that I need to test everything ,not just 1 or 2 methods but everything !</p>
<p>And boom ! the delete and put methods don&#8217;t work ! what&#8217;s going on !</p>
<p>I mean they work in Visual studio ?! they work in app service  on azure !</p>
<p>What&#8217;s going on and what the heck is this !</p>
<p>&#8221; IIS 10.0 Detailed Error &#8211; 405.0 &#8211; Method Not Allowed &#8221;</p>
<p>it&#8217;s Friday 5 PM and this happens .. &#8220;the difference between the past and the present  that , I used to freak out but now I smile and say : Oh yeah , something new to learn and share !&#8221;</p>
<p>So , I said to my self : right now I have 3 goals :</p>
<p>1- Fix this no matter what, so it&#8217;s works and the client can start testing</p>
<p>2- know why this happened and fix it if it needs to be fixed again.</p>
<p>3-share this .</p>
<p>&nbsp;</p>
<p>So ,I started the search and if you are looking to quick fix all you have to do now is to insert those lines to <strong>web.config </strong>under system.webServer</p>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">&lt;modules runAllManagedModulesForAllRequests="false"&gt; 
        &lt;remove name="WebDAVModule" /&gt; 
        &lt;/modules&gt;</pre>
<p><strong>PS</strong> : You may need to recycle the app pool or restart IIS for this change to take effect.</p>
<p>Now it&#8217;s time to understand why this happened ,the first tought that came to my mind is WebDav can cause IIS to block the Delete and the Put calls ,and if there is no WebDav there is no problem and no block .</p>
<h1><strong>What is WebDAV?</strong></h1>
<p>WebDAV is short for Web Distributed Authoring and Versioning, and it is an open-standard extension to the HTTP protocol that enables file management over the Internet. In addition to the usual file system-like operations (copy, move, delete, etc), WebDAV adds a flexible property mechanism (based on name/value pairs) and resource locking. WebDAV is a critical component in Microsoft&#8217;s web publishing story, used by the WebDAV redirector, Web Folders, SMS/SCCM, and many other components.</p>
<p>Anonymous PROPFINDs are allowed for file listings, but file uploads and WebDAV-based GET requests require an authenticated user. This is a change from IIS 6.0, where anonymous WebDAV file uploads/downloads could be enabled by opening up your security. In WebDAV for IIS 7.0 and above we changed this behavior so that all WebDAV activity would require authentication, but we allow for the use of anonymous PROPFINDs for backward-compatibility with some WebDAV clients. (<strong>More specifically, the PUT, MKCOL, PROPPATCH, COPY, MOVE, DELETE, and WebDAV-based GET requests all require authentication.</strong>)</p>
<p>If you need more informations you can read from :  <a href="https://docs.microsoft.com/en-us/iis/get-started/whats-new-in-iis-7/what39s-new-for-webdav-and-iis-7">link</a></p>
<h1><strong>The Fix  </strong></h1>
<h2>After understanding what is WebDav now it&#8217;s time to see the fix and how can be done .</h2>
<h2>1-Deleting WebDAV :</h2>
<p>If there is no need for you to use WebDav in general , you can remove it from the system , if you are using windows 10 you can go to &#8220;Turn Windows Features On or Off&#8221; and uncheck it</p>
<p>&nbsp;</p>
<p><a href="https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/wp-content/uploads/2020/10/webdav-1.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-852" src="https://achrafbenalaya-ekgvbjdjgta4b4hz.francecentral-01.azurewebsites.net/wp-content/uploads/2020/10/webdav-1.png" alt="" width="675" height="482" srcset="/wp-content/uploads/2020/10/webdav-1.png 675w, /wp-content/uploads/2020/10/webdav-1-300x214.png 300w, /wp-content/uploads/2020/10/webdav-1-120x86.png 120w, /wp-content/uploads/2020/10/webdav-1-350x250.png 350w" sizes="(max-width: 675px) 100vw, 675px" /></a></p>
<p>In Windows Server you need to go to removing features in server manager .</p>
<h2>2- A Quick Fix :</h2>
<p>The fix can be done by adding to the web.config:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">&lt;modules runAllManagedModulesForAllRequests="false"&gt; 
        &lt;remove name="WebDAVModule" /&gt; 
        &lt;/modules&gt;</pre>
<p>&nbsp;</p>
<p>hope this was helpful <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://achrafbenalaya.com/2020/10/17/405-method-not-allowed-in-iis/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">848</post-id>	</item>
	</channel>
</rss>
