November 9th, 2010
You can run powershell commands on your Exchange 2010 server from machines whether or not they have the Exchange Management Tools installed using implicit remoting.
Even when you run the Exchange Management Shell on your exchange server, you’re essentially creating a powershell remoting session. The following steps take place in the background when you click the EMS icon:
Load the Microsoft.Exchange.Management.PowerShell.E2010 snap-in gets loaded
The RemoteExchange.ps1 script is dot sourced
The Connect-ExchangeServer function is executed
You can set up implicit remoting from any maching using powershell v2. This imports the commands from your exchange server to your local powershell session so you don’t need any Exchange tools installed.
First we create a session using the New-PSSession cmdlet:
$s = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://<CAS FQDN>/PowerShell/ -Authentication Kerberos
Then, import the session using the Import-PSSession cmdlet:
Import-PSSession $s
The Exchange Management Shell commands are now imported into the local PowerShell session.
You could use the same method to setup a scheduled task from your machine to run a commands on your exchange server.
[source: ]
Posted in howto, windows | No Comments »
October 20th, 2010
This is perhaps the best tutorial on how to set up Active Directory integration in CentOS.
http://www.linuxmail.info/active-directory-integration-samba-centos-5/
Update:
A related link on setting up Kerberos
http://www.howtoforge.com/samba_ads_security_mode
Posted in *nix, howto | No Comments »
October 5th, 2010
The sfc /scannow command (System File Checker) scans the integrity of all protected Windows 7 (XP or Vista as well) system files and replaces incorrect corrupted, changed, or damaged versions with the correct versions if possible.
Running the command requires an elevated command prompt. A log file of the entire operation is created at C:\WINDOWS\LOGS\CBS\CBS.LOG.
The following command extracts the ‘fixes’ from the log and places it in a file called sfcdetails.txt.
findstr /c:"[SR]" %windir%\logs\cbs\cbs.log > sfcdetails.txt
Posted in Uncategorized | No Comments »
August 3rd, 2010
So you inherit a box running linux and you have no idea which flavor of linux it is. How do you find out?
If all you need the kernel version you can try
uname -a
This outputs something like this
Linux localhost.localdomain 2.4.20-31.9 #1 Tue Apr 13 18:04:23 EDT 2004 i686 i686 i386 GNU/Linux
If you need the actual distro name you can try
cat /etc/*release
In Ubuntu it shows up as
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=9.04
DISTRIB_CODENAME=jaunty
DISTRIB_DESCRIPTION=”Ubuntu 9.04″
Or even
cat /etc/issue
which spits out the following on Ubuntu
Ubuntu 9.04 \n \l
You can combine all three to get the following
uname -a && cat /etc/*release && cat /etc/issue
Update:
Another one to add to the list
cat /proc/version
Posted in *nix, howto | No Comments »
April 27th, 2010
Active Directory doesn’t let you edit the Dial-up of VPN access policies for multiple users at once through the GUI. You have to edit this setting one at a time for each user. This can be painstaking if you a lot of users. Luckily there is a VB script available like for almost everything else in AD.
Dim aConnection, aCommand, aResult, strLDAPPath, user, objUser
Const ADS_PROPERTY_CLEAR = 1
strLDAPPath = InputBox("Please enter the LDAP path of the OU:")
WScript.Echo strLDAPPath
Set aConnection = CreateObject("ADODB.Connection")
Set aCommand = CreateObject("ADODB.Command")
aConnection.Provider = "ADsDSOObject"
aConnection.Open
aCommand.ActiveConnection = aConnection
aCommand.CommandText=";(&(objectCategory=Person)(objectClass=User));distinguishedName;subTree"
Set aResult = aCommand.Execute()
Do While Not aResult.EOF
strDN = aResult.Fields("distinguishedName")
WScript.Echo strDN
Set objUser = GetObject("LDAP://" & strDN)
' Comment the following line to manage connection through Remote Access Policy
objUser.Put "msNPAllowDialin", FALSE
' Uncomment the following line to manage connection through Remote Access Policy
' objUser.PutEx ADS_PROPERTY_CLEAR, "msNPAllowDialin", 0
objUser.SetInfo
aResult.MoveNext
Loop
This script will update the access settings for a group of users in a particular OU. Once you run the script, a dialog box will ask you for this OU. Once this is set all users in that OU will be updated.
The AD property this script modifies is ‘msNPAllowDialin’. This property is accepts boolean values. So the three options are
TRUE (to allow access)
FALSE (to deny access)
To manage access via the Remote Access Policy, comment out the
objUser.Put "msNPAllowDialin", FALSE
and uncomment the
' objUser.PutEx ADS_PROPERTY_CLEAR, "msNPAllowDialin", 0
line.
Posted in howto, windows | No Comments »