Get .NET Framework Version of an assembly (dll/exe) using PowerShell

i just had to find the required framework version for a compiled .NET assembly (just to make sure, that the selected Application Pool in IIS was set to the righte Framework Version).

——–

$fileBrowser = New-Object System.Windows.Forms.OpenFileDialog -Property @{
 Filter = 'Assemblies (*.dll & *.exe)|*.dll'
 MultiSelect = $true}
 [void]$fileBrowser.ShowDialog()
 $files = $fileBrowser.FileNames
  
 foreach($file in $files)
 {
 $version = [System.Reflection.Assembly]::ReflectionOnlyLoadFrom($file).ImageRuntimeVersion;
 echo "$($file) is using Framework: $version"
 }
 

————–

Debugging Group Policy Processing

Group Policy Debug Log Settings

The below article has got information about enabling different debug loggings which are required for troubleshooting various Windows issues.

UserEnv Debug Logging

Userenv logging is useful when troubleshooting group Policy application related issues or User profile related issues.

Continue reading

Truncate Logfile in SQL Server

Using the code

Step 1. Copy/type the below given SQL.

Step 2. Change @DBName to < Database Name>, @DBName_log to

Step 3. Execute the SQL.

ALTER DATABASE @DBName SET RECOVERY SIMPLE WITH NO_WAIT
DBCC SHRINKFILE(@DBName_log, 1)
ALTER DATABASE @DBName SET RECOVERY FULL WITH NO_WAIT
GO  

In SQL Server data is stored using two physical files: 

  1. (.mdf)  extension  which contains the data. 
  2. (.ldf) extension which contains log.

Log file size increases very rapidly and depend on the operation performed on the data. After a long time period this file becomes too large. When log file is too large it takes time to perform some operations like ( attach , de-attach, backup, restore … etc ). 

How to configure Windows Time Synchronization (w32tm.exe) on a Windows Server 2008 R2 PDC

This article explains how to configure your Windows Server 2008 R2 Active Directory Primary Domain Controller to syncronise time with an external time source.

Note: In an active directory, all member computers will sync time with the PDC, so you only need to setup an external time source on the PDC.

Open an elevated command prompt and type the following:
Note: this is for switzerland. More NTP names can be found here: http://www.pool.ntp.org/en/

w32tm /config /manualpeerlist:"0.ch.pool.ntp.org 1.ch.pool.ntp.org 2.ch.pool.ntp.org 3.ch.pool.ntp.org" /syncfromflags:manual /reliable:yes /update
net stop w32time
net start w32time
w32tm /config /update
w32tm /resync
w32tm /resync

You can run W32tm /resync on member computers to sync time with the PDC.

Links

Configure the Windows Time service on the PDC emulator in the Forest Root Domain

How do I find orphaned computer objects in Active Directory using PowerShell?

How can I find all computer accounts in my Active Directory domain that have been inactive for x days using PowerShell?

This would give you all computer accounts that have no activity for the last 365 Days.

Search-ADAccount -AccountInactive -ComputersOnly -TimeSpan 365.00:00:00

This would sort it for you by lastlogondate.

Search-ADAccount -AccountInactive -ComputersOnly -TimeSpan 365.00:00:00 | Sort-Object lastlogondate | Ft name,lastlogondate -auto

This would give you disabled computer accounts.

Search-ADAccount -AccountDisabled -ComputersOnly 

Media added to DLNA shared library does not show up in Samsung Allshare Play

I’m streaming a lot of my media directly to my Samsung TV (Allshare). lately I added music to my Music Library in Microsoft Windows 8. The Library is shared using DLNA Protocol. For some reason, the newly added media did not show up am my Samsung TV. I started playing around with the configuration of DLNA/Homegroup/Sharing and finally I realized (and that’s an assumption), that the whole sharing stuff, especially when it comes to indexing the media, is managed by Windows Media Player (WMP).

I started Windows Media Player and under Streaming I clicked on More Streaming Options

Combobox Show Devices On => choose All networks

Select the relevant Device and click on Customize.

Then uncheck “Use Default settings”
and then check “Make all my media available to this device.”

2013-03-17 11_23_31-Media streaming options

2013-03-17 11_23_31-Media streaming options

Finally my newly added media has shown up in Allshare/Samsung TV.

Send text messages directly from any e-mail program (Outlook, Thunderbird..)

eSMS by Dolphin Systems allows you to send and receive text messages from any e-mail program.
You must have a Swisscom mobile phone number for using eSMS.

Ready for immediate use

Before you can use eSMS, you have to register via text message; follow the relevant user manual for this. You can then use eSMS immediately.

Billing directly on your mobile phone

The billing of SMS messages is done via the mobile phone bill or prepaid credit from the mobile number given at registration. The costs per SMS (160 characters) is CHF 0.20.

The advantages

  • Very easy setup

  • Send and receive SMS

  • Direct answers back

  • Contacts from Outlook adress book

  • Preview of the transmission order

  • Delayed transmission

Very easy to use

pdfeSMS Manual for MS Outlook 2010

pdfeSMS Manual for MS Outlook 2007

For users of MS Outlook 2003 and other e-mail programs:

pdfeSMS Manual for all e-mail programs

Remote Server Administration Tools for Windows 8 Release Preview

Remote Server Administration Tools for Windows 8 Release Preview enables IT administrators to manage roles and features that are installed on computers that are running Windows Server 2012 from a remote computer that is running Windows 8 Release Preview.

Overview

Remote Server Administration Tools for Windows 8 Release Preview includes Server Manager, Microsoft Management Console (MMC) snap-ins, consoles, Windows PowerShell cmdlets and providers, and command-line tools for managing roles and features that run on Windows Server 2012. In limited cases, the tools can be used to manage roles and features that are running on Windows Server 2008 R2 or Windows Server 2008. Some of the tools work for managing roles and features on Windows Server 2003.

Continue reading

Use PowerShell to Back Up System State Prior to Making Changes

Did you know you can use PowerShell to back up the system state?

Understanding the Computer Restore cmdlets

One of the easiest ways to ensure system reliability is to create a restore point prior to making potentially damaging changes. In this way, if a problem arises, it is rather simple to roll back the changes. In Windows PowerShell, the easy way to create a restore point is to use the Windows PowerShell cmdlets. These cmdlets require administrator rights (due to access to protected registry keys and other vital configuration files). Therefore, you need to right-click the Windows PowerShell icon and select Run As Administrator from the Action menu. Keep in mind that these cmdlets only work on client systems later than Windows XP. These cmdlets do not work on server versions of the operating system.

 

Continue reading