Setup scenario is that user folders are in a single centralized share and they all access their folder with proper permission on the folders so that only they can have an access to a folder.
Some of the users had intermittent issues of their folders not syncing properly or their files would randomly get locked and they could not save the file without saving as different name.
FIX:
Give root folder that is shared out a special permissions for "Authenticated Users" (or some other group if you wish to limit share access to only certain user group) under advanced options. The permissions required are: "Traverse folder /execute file", "Read attributes" and "read extended attributes"
NOTE:
Permissions above need to be applied only on root folder so make sure "This folder only" is selected while changing permissions.
Showing posts with label Windows Server 2008. Show all posts
Showing posts with label Windows Server 2008. Show all posts
Tuesday, March 25, 2014
Tuesday, September 17, 2013
More usefull powershell commands
Alternate authentication cmdlet
Sometimes it is pretty useful to be able and use alternate credentials in PowerShell command. This can be done by using Get-Credential cmdlet but a downside is that you can not specify password. Instead what will happen every time this cmdlet is ran it will produce a popup box to enter password.
A nice workaround is to store the credentials in encrypted variable such as $cred = Get-Credential Administrator this will initially pop up with authentication box where password is typed in but afterwards you can use $cred variable in your session without need to type it in again.
Run PowerShell command in background and keep control of your session for other tasks
In the situation where we need to run a cmdlet where output will take a while to be produced we can use -asjob switch. This will give us back our prompt to run additional command while our initial query will run in the background. Some of the related cmdlets with which we can control or view jobs are: Get-Job, Receive-Job, Remove-Job, Resume-Job, Start-Job, Stop-Job, Suspend-Job, Wait-Job
Output text in PowerShell
Write-Output
Input some text into powershell
Read-Host
Convert output of query to HTML
This is specifically usefully if desired output needs to be shared for wide audience. All needs to be done is convert it to HTML using ConvertTo-hmtl and output to file using Out-File to write contents into file on web server and your info is readily available for brain consumption.
Import contents of file into PowerShell for processing
Best example for this would be creating multiple users in AD from predefined csv file. We can use Import-CSV cmdlet to take a contents of csv file and pipe it into another cmdlet such as Import-CSV file.csv | New-ADUser. Please note that header of csv file should contain valid AD properties for user. Whichever properties you have, those properties will be created along with a user.
Sometimes it is pretty useful to be able and use alternate credentials in PowerShell command. This can be done by using Get-Credential cmdlet but a downside is that you can not specify password. Instead what will happen every time this cmdlet is ran it will produce a popup box to enter password.
A nice workaround is to store the credentials in encrypted variable such as $cred = Get-Credential Administrator this will initially pop up with authentication box where password is typed in but afterwards you can use $cred variable in your session without need to type it in again.
Run PowerShell command in background and keep control of your session for other tasks
In the situation where we need to run a cmdlet where output will take a while to be produced we can use -asjob switch. This will give us back our prompt to run additional command while our initial query will run in the background. Some of the related cmdlets with which we can control or view jobs are: Get-Job, Receive-Job, Remove-Job, Resume-Job, Start-Job, Stop-Job, Suspend-Job, Wait-Job
Output text in PowerShell
Write-Output
Input some text into powershell
Read-Host
Convert output of query to HTML
This is specifically usefully if desired output needs to be shared for wide audience. All needs to be done is convert it to HTML using ConvertTo-hmtl and output to file using Out-File to write contents into file on web server and your info is readily available for brain consumption.
Import contents of file into PowerShell for processing
Best example for this would be creating multiple users in AD from predefined csv file. We can use Import-CSV cmdlet to take a contents of csv file and pipe it into another cmdlet such as Import-CSV file.csv | New-ADUser. Please note that header of csv file should contain valid AD properties for user. Whichever properties you have, those properties will be created along with a user.
Monday, September 9, 2013
Script to find files in size greater than desired size
Very useful when you need to find large size files on your system. This command can be run locally or on remote system as long as you have admin rights to remote system.
Get-ChildItem \\servername\c$ -Recurse -ErrorAction "SilentlyContinue" | Where-Object {$_.Length -gt 100MB} | Export-Csv c:\temp\myLargeFilesOnC_Report1.csv
Labels:
Microsoft,
Powershell,
Windows 7,
Windows Server 2008
Thursday, August 29, 2013
IP address already assigned to another adapter
This issue occurs if a network adapter with the same IP address is in the
Windows registry but is hidden in the Device Manager (My Computer >
Properties > Hardware > Device Manager). This hidden
adapter is called a ghosted network adapter.
- You may see this if you recently performed a P2V and the resulting virtual machine still has the physical NICs and drivers for those NICs present. These ghost NICs have the old IP address and the virtual NIC cannot be assigned the same IP address.
Using the Show hidden devices option in the Device Manager
(View > Show hidden devices) does not always show the old
virtual NIC (ghosted adapter) to which that IP Address is assigned.
To resolve this issue, make the ghosted network adapter visible in the
Device Manager and uninstall the ghosted network adapter from the
registry:
- Click Start > Run.
- Type cmd and press Enter.
- At the command prompt, run this
command:
Note: In Windows 2008 and Windows 7, open the command prompt using the Run as Administrator option.
set devmgr_show_nonpresent_devices=1
Note: If this command does not work (a possibility in Windows Server 2000 and 2003), you may need to add the parameter to Windows and set its value:
- Right-click the My Computer desktop icon and choose Properties.
- Click the Advanced tab and select Environment Variables.
- In the System variables section, click New.
- Set the Variable name to devmgr_show_nonpresent_devices and set the Variable value to 1 to enable the parameter.
- Click OK to add the variable to Windows.
start devmgmt.msc
Note: To assign the IP address to the virtual NIC on the command line, run the command:
netsh interface ip set address "Local Area Connection #" static IP_Address Subnet_Mask Default_Gateway
For example:
netsh interface ip set address "Local Area Connection 2" static 192.168.1.101 255.255.255.0 192.168.1.1
Labels:
Networking,
VMware,
windows server 2003,
Windows Server 2008
Tuesday, May 21, 2013
Time sync with external NTP on windows server 2008 R2 DC
- Locate PDC - C:\>netdom /query fsmo
- Log in to PDC Server and open the command prompt.
- Stop the W32Time service: C:\>net stop w32time
- Configure the external time sources, type: C:\> w32tm /config /syncfromflags:manual /manualpeerlist:”0.pool.ntp.org, 1.pool.ntp.org, 2.pool.ntp.org”
- Make your PDC a reliable time source for the clients. Type: C:\>w32tm /config /reliable:yes
- Start the w32time service: C:\>net start w32time
- The windows time service should begin synchronizing the time. You can check the external NTP servers in the time configuration by typing: C:\>w32tm /query /configuration
- Check the Event Viewer for any errors.
Labels:
Active Directory,
Microsoft,
NTP,
Windows Server 2008
Friday, April 27, 2012
What to look for when installing DHCP on windows server 2008 that is also DC
Make sure DHCP is not running as a system account. This change is not necessary if DHCP is running on member server of domain.
http://support.microsoft.com/kb/282001
Also very usefull article about DNS and DHCP correlation:
http://technet.microsoft.com/en-us/library/dd145315%28WS.10%29.aspx
By Using the DHCP Server Snap-In
- In the DHCP Server snap-in, which is located in the Administrative Tools folder, right-click the DHCP server that you want to configure, and then click Properties.
- On the Advanced tab, click Credentials.
- Type the username, domain and password of the account under which you want the DHCP Server service to run. You can use any valid existing user account for this, such as a Domain User account. The account should not be set to expire or have any other restrictions.
- Click OK, and then OK again to exit the Properties dialog box.
By Using the Netsh.exe Command Line
- From a command prompt, type netsh, and then press ENTER.
- From the netsh prompt, type dhcp server ipaddress (where ipaddress is the IP address of the DHCP server that you want to configure), and then press ENTER.
- Type set dnscredentials username domain password (where username domain password is the user account information for the account under which you want the DHCP Server to run), and then press ENTER. You can use any valid existing user account for this, such as a Domain User account. The account should not be set to expire or have any other restrictions.
- Type quit, and then press ENTER to exit.
http://support.microsoft.com/kb/282001
Also very usefull article about DNS and DHCP correlation:
http://technet.microsoft.com/en-us/library/dd145315%28WS.10%29.aspx
Labels:
DHCP,
DNS,
windows server 2003,
Windows Server 2008
Subscribe to:
Posts (Atom)