1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | ############################################################################################################### ##Deactivate a Feature on all Sites for a web application ### ## http://Blog.IsaacBlum.com ## ############################################################################################################### ############################################################################################################### #Create function deactivatefeature function deactivatefeature{ ## Reference to SharePoint DLL [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") ## Location of sharepoint STSADM utility program, You may need to change this $stsadm = "$env:programfiles\Common Files\Microsoft Shared\Web Server Extensions\12\BIN\STSADM.EXE" #Ask for WebApp Root url to enumerate $url = Read-Host "Please enter root url of WebApplication" #Enumerate available features in SharePoint Farm write-host -foregroundcolor green " Below are the available features in SharePoint Farm" &stsadm -o scanforfeatures #Ask for Feature Name Write-Host "Please enter feature name that will be deactivated at all Sites and Sub-Sites of the specified application" $feature = Read-Host "do not add the \feature.xml. ex: NewsGator.SocialSites.SiteSkin" #Returning info for use in remainder of script $webapp = [Microsoft.SharePoint.Administration.SPWebApplication]::Lookup($url) #List Sites Affected write-host -foregroundcolor green " The feature will be deactivated on the following Sites:" foreach ($site in $webapp.Sites) { # write-host $webapp.Name foreach ($web in $site.AllWebs) { write-host $web.URL }} ##Actvate Feature on all Sites foreach ($site in $webapp.Sites) { foreach ($web in $site.AllWebs) { $sResult = &stsadm -o deactivatefeature -name $feature -url $web.URL -force if(($sResult -like "*Operation completed successfully*")){ write-host -foregroundcolor green "Feature Deactivated : "$web.URL} else { Write-Host -ForegroundColor "red" -BackgroundColor "white" "Deactivate of feature '$feature' for" $web.URL "Failed! `n $sResult" } } } } ############################################################################################################### ############################################################################################################### ############################################################################################################### |
Archive for the ‘Uncategorized’ Category
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | ########################################################## ##Actvate a Feature on all Sites for a web application ### ## http://Blog.IsaacBlum.com ## ########################################################## ########################################################## #Create function activatefeature function activatefeature{ ## Reference to SharePoint DLL [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") ## Location of sharepoint STSADM utility program, You may need to change this $stsadm = "$env:programfiles\Common Files\Microsoft Shared\Web Server Extensions\12\BIN\STSADM.EXE" #Ask for WebApp Root url to enumerate $url = Read-Host "Please enter root url of WebApplication" #Enumerate available features in SharePoint Farm write-host -foregroundcolor green " Below are the available features in SharePoint Farm" &stsadm -o scanforfeatures #Ask for Feature Name Write-Host "Please enter feature name that will be activated at all Sites and Sub-Sites of the specified application" $feature = Read-Host "do not add the \feature.xml. ex: %featurename%" #Returning info for use in remainder of script $webapp = [Microsoft.SharePoint.Administration.SPWebApplication]::Lookup($url) #List Sites Affected write-host -foregroundcolor green " The feature will be actvated on the following Sites:" foreach ($site in $webapp.Sites) { # write-host $webapp.Name foreach ($web in $site.AllWebs) { write-host $web.URL }} ##Actvate Feature on all Sites foreach ($site in $webapp.Sites) { foreach ($web in $site.AllWebs) { $sResult = &stsadm -o activatefeature -name $feature -url $web.URL -force if(($sResult -like "*Operation completed successfully*")){ write-host -foregroundcolor green "Feature Actvated : "$web.URL} else { Write-Host -ForegroundColor "red" -BackgroundColor "white" "Activate of feature '$feature' for" $web.URL "Failed! `n $sResult" } } } } ######## ######## ######## |
Thanks to http://www.pgrconsulting.com/useful_p_and_t.htm
– Create the temp table for further querying
CREATE TABLE #temp(
rec_id int IDENTITY (1, 1),
table_name varchar(128),
nbr_of_rows int,
data_space decimal(15,2),
index_space decimal(15,2),
total_size decimal(15,2),
percent_of_db decimal(15,12),
db_size decimal(15,2))
– Get all tables, names, and sizes
EXEC sp_msforeachtable @command1=”insert into #temp(nbr_of_rows, data_space, index_space) exec sp_mstablespace ‘?’”,
@command2=”update #temp set table_name = ‘?’ where rec_id = (select max(rec_id) from #temp)”
– Set the total_size and total database size fields
UPDATE #temp
SET total_size = (data_space + index_space), db_size = (SELECT SUM(data_space + index_space) FROM #temp)
– Set the percent of the total database size
UPDATE #temp
SET percent_of_db = (total_size/db_size) * 100
– Get the data
SELECT *
FROM #temp
ORDER BY total_size DESC
– Comment out the following line if you want to do further querying
DROP TABLE #temp
- Click Start, click Run, type regedit, and then click OK.
- Locate the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
- Using your account name and password, double-click the DefaultUserName entry, type your user name, and then click OK.
- Double-click the DefaultPassword entry, type your password under the value data box, and then click OK.
If there is no DefaultPassword value, create the value. To do this, follow these steps:
- In Registry Editor, click Edit, click New, and then click String Value.
- Type DefaultPassword as the value name, and then press ENTER.
- Double-click the newly created key, and then type your password in the Value Data box.
If no DefaultPassword string is specified, Windows XP automatically changes the value of the AutoAdminLogon registry key from 1 (true) to 0 (false) to turn off the AutoAdminLogon feature.
- Double-click the AutoAdminLogon entry, type 1 in the Value Data box, and then click OK.
If there is no AutoAdminLogon entry, create the entry. To do this, follow these steps:
- In Registry Editor, click Edit, click New, and then click String Value.
- Type AutoAdminLogon as the value name, and then press ENTER.
- Double-click the newly created key, and then type 1 in the Value Data box.
- Quit Registry Editor.
- Click Start, click Restart, and then click OK.
I am not the orginal author. I have updated some of the info:
Consider the following file scanning exceptions for your Anti-Virus software where applicable:
NOTE: The %systemroot% is normally the C:\WINDOWS or C:\WINNT directory depending on your OS.
NOTE: the %systemroot% variable will not work as an exclusion for some OSs. So make sure to spell out full path in your exclusion files (GPO or via AntiVirus Server)
1.) %systemroot%\System32\Spool (and all the sub-folders and files)
2.) %systemroot%\SoftwareDistribution\Datastore
Refer to the following article for information:
KB822158 – Virus scanning recommendations for computers that are running Windows Server 2003, Windows 2000, or Windows XP http://support.microsoft.com/kb/822158
3.) Any Network Drives that are mapped.
The following steps are Server Role specific:
==========================================================
1.) If your system is also a Domain Controller (DC) / DNS / DHCP also exclude the following from Anti-Virus Scanning:
a.) %systemroot%\Sysvol folder (include all the sub-folders and files)
b.) %systemroot%\system32\dhcp folder (include all the sub-folders and files)
c.) %systemroot%\system32\dns folder (include all the sub-folders and files)
d.) %systemroot%\ntds
Refer to the following article for information:
KB822158 – Virus scanning recommendations for computers that are running Windows Server 2003, Windows 2000, or Windows XP http://support.microsoft.com/kb/822158
2.) If File Replication (NTFR) service is running on your system, make sure your Anti-Virus software is compatible:
KB815263 – Antivirus, backup, and disk optimization programs that are compatible with the File Replication Service
http://support.microsoft.com/kb/815263
And exclude:
a.) %systemroot%\ntfrs folder (include all the sub-folders and files)
b.) Files that have the .log and .dit extension
3.) If you have IIS installed, exclude:
a.) The IIS compression directory (default compression directory is %systemroot%\IIS Temporary Compressed Files)
b.) %systemroot%\system32\inetsrv folder
c.) Files that have the .log extension
Refer to the following knowledge base articles for reference:
KB817442 – IIS 6.0: Antivirus Scanning of IIS Compression Directory May Result in 0-Byte File
http://support.microsoft.com/kb/817442
KB821749 – Antivirus software may cause IIS to stop unexpectedly
http://support.microsoft.com/kb/821749
4.) If you have SQL installed, you may want to exclude the SQL folder and databases files (or database file types) from scanning for performance reasons:
KB309422 – Guidelines for choosing antivirus software to run on the computers that are running SQL Server
http://support.microsoft.com/kb/309422
5.) If you have Exchange installed, perform the relevant file-based scanning exclusions listed in Knowledge Base articles:
KB328841 – Exchange and antivirus software
http://support.microsoft.com/kb/328841
KB823166 – Overview of Exchange Server 2003 and antivirus software
http://support.microsoft.com/kb/823166
KB245822 – Recommendations for troubleshooting an Exchange Server computer with antivirus software installed
http://support.microsoft.com/kb/245822
6.) If you have Cluster services, make sure your Anti-Virus software is compatible:
KB250355 – Antivirus Software May Cause Problems with Cluster Services
http://support.microsoft.com/kb/250355
NOTE: If you have a SQL cluster, make sure that you exclude these locations from virus scanning:
a.) Q:\ (Quorum drive)
b.) %systemroot%\Cluster
c.) SQL Server data files that have the .mdf extension, the .ldf extension, and the .ndf extension
7.) If you have Sharepoint installed, you should exclude:
a.) Drive:\Program Files\SharePoint Portal Server
b.) Drive:\Program Files\Common Files\Microsoft Shared\Web Storage System
c.) Drive:\MSDEDatabases (particularly on SBS) (where Drive: is the drive letter where you installed SharePoint Portal Server)
Refer to the following knowledge base articles for reference:
KB320111 – Random Errors May Occur When Antivirus Software Scans Microsoft Web Storage System
http://support.microsoft.com/kb/320111
KB322941 – Microsoft’s Position on Antivirus Solutions for Microsoft SharePoint Portal Server
http://support.microsoft.com/kb/322941
8.) If you have a Systems Management Server (SMS), you should exclude folders:
a.) SMS\Inboxes
b.) SMS_CCM\ServiceData
Refer to the following knowledge base articles for reference:
KB327453 – Antivirus programs may contribute to file backlogs in SMS 2.0 and in SMS 2003
http://support.microsoft.com/kb/327453
NOTE: If you exclude the SMS\Inboxes directory from virus scanning or remove the antivirus software, you may make the site server and all clients vulnerable to potential virus risks. The client base component files reside in the SMS\Inboxes directory.
9.) If you have a MOM (Microsoft Operations Manager) Server, you consider excluding:
a.) Drive:\Documents and Settings\All Users\Application Data\Microsoft\Microsoft Operations Manager
b.) Drive:\Program Files\Microsoft Operations Manager 2005 (where Drive: is the drive letter where profiles are located)
10.) If you have an Internet Security and Acceleration Server (ISA) Server, you should exclude:
a.) The ISALogs folder. By default, the ISALogs folder is located in the folder where you installed ISA Server. Typically, this location is Drive:\Program Files\Microsoft ISA Server.
Refer to the following knowledge base articles for reference:
KB887311 – Event ID 5, event ID 14079, and event ID 14176 are logged in the Application log on your Internet Security and Acceleration Server 2000 computer
http://support.microsoft.com/kb/887311
11.) If you have a Windows Software Update Services (WSUS) Server role, you consider excluding:
a.) Drive:\MSSQL$WSUS
b.) Drive:\WSUS
(where Drive: is the drive letter where you installed Windows Software Update
Services)
Also refer to the following knowledge base articles for reference:
KB900638 – Multiple symptoms occur if an antivirus scan occurs while the Wsusscan.cab file is copied
http://support.microsoft.com/kb/900638
MORE INFORMATION:
KB49500 – List of antivirus software vendors
http://support.microsoft.com/kb/49500
KB129972 – Computer viruses: description, prevention, and recovery
http://support.microsoft.com/kb/129972
Small Business Server (SBS):
========================================
KB885685 – How to troubleshoot the POP3 Connector in Windows Small Business Server 2003
http://support.microsoft.com/kb/885685
SOX050603700001 – How do I exclude a file from AV scanning?
SOX040212700018 – Anti Virus Software and System State Backup
SOX060301700048 – ISA 2004 Firewall Service crashes intermittently with Event ID: 5 Source: Microsoft Firewall
SOX060307700037 – MOM 2005/ File level Anti-virus scanners
SOX061205700029 – MOM Agent Installation fails with -2147023277
KB837932 – Event ID 2108 and Event ID 1084 occur during inbound replication of Active Directory in Windows 2000 Server and in Windows Server 2003
http://support.microsoft.com/kb/837932
Anti-Virus folder exclusions have not been configured (Exchange)
http://www.microsoft.com/technet/prodtechnol/exchange/Analyzer/9fb755f5-5f0b-4817-a584-70c76a62eae2.mspx
Process: Manage Antivirus Software on Domain Controllers
http://www.microsoft.com/technet/solutionaccelerators/cits/mo/winsrvmg/adpog/adpog3.mspx#
The script is already placed in systemroot\system32 on Windows Server 2003 so simply go to your Command Prompt and type in iisapp.vbs (the .vbs is optional) and you’ll have an instant list of all the App Pool information you’ve always wanted to know. You may need to type cscript iisapp.vbs if CScript isn’t your default WSH script host.
Let’s see an example of the output:
W3WP.exe PID: 1468 AppPoolId: AppPoolForSite1.com
W3WP.exe PID: 3056 AppPoolId: AppPoolForSite2.com
W3WP.exe PID: 1316 AppPoolId: AppPoolForSite3.com
Microsoft documents this:
http://www.microsoft.com/resources/documentation/WindowsServ/2003
SQL Server 2005 improves on the current situation by making the EXECUTE permission grantable at the database scope. This means that we can issue a statement like the example below and this will GRANT execute permissions on all existing stored procedures and scalar functions AND all subsequently created ones. Thus it acts very much like the current fixed database roles such as db_datareader
/* CREATE A NEW ROLE */ CREATE ROLE db_executor /* GRANT EXECUTE TO THE ROLE */ GRANT EXECUTE TO db_executor |
2. Put this code:
Set objEmail = CreateObject(“CDO.Message”)
objEmail.From = “yourmail@yourserver.com”
objEmail.to = WScript.Arguments(1)
objEmail.Subject = WScript.Arguments(2)
objEmail.Textbody = WScript.Arguments(3)
objEmail.Configuration.Fields.Item (“http://schemas.microsoft.com/cdo/configuration/sendusing”) = 2
objEmail.Configuration.Fields.Item (“http://schemas.microsoft.com/cdo/configuration/smtpserver”) = “your_SMTP_server_IP_or_name”
objEmail.Configuration.Fields.Item (“http://schemas.microsoft.com/cdo/configuration/smtpserverport”) = 25
objEmail.Configuration.Fields.Update
objEmail.Send
set objEmail = Nothing
3. And now, complete creating a stored procedure:
USE MASTER
GO
CREATE PROCEDURE sp_sendmail @mail varchar(150), @subject varchar(150), @textbody varchar(800) AS
DECLARE @MSG_SENT VARCHAR(1200)
SELECT @MSG_SENT = ‘cscript c:\winnt\sendmail.vbs /p “‘ + @mail + ‘” “‘ + @subject + ‘” “‘ + @textbody + ‘”‘
exec master.dbo.xp_cmdshell @MSG_SENT, NO_OUTPUT
SELECT ‘Mail sent!’
GO
******************************************************************
Ok, allright!
Send a mail to test:
EXEC master.dbo.sp_sendmail ‘yourto@yourserver.com’, ’subject’, ‘message’
| Article ID | : | 925083 |
| Last Review | : | March 5, 2008 |
| Revision | : | 4.0 |
On This Page
SYMPTOMS
This problem occurs if the following conditions are true:
| • | You configured the Microsoft Windows SharePoint Services 3.0 site to support large files by following the steps on the following Microsoft Web site:
http://office.microsoft.com/en-us/assistance/HA011607881033.aspx (http://office.microsoft.com/en-us/assistance/HA011607881033.aspx)
|
| • | The file is larger than 50 megabytes (MB). |
RESOLUTION
| • | Increase the maximum upload size for the virtual server settings in Microsoft Internet Information Services (IIS). |
| • | Increase the connection time-out setting in IIS. |
| • | Add the executionTimeout value in the Web.config file. |
Increase the maximum upload size
| 1. | Click Start, point to All Programs, point to Administrative Tools, and then click SharePoint Central Administration. |
| 2. | Under Virtual Server Configuration, click Configure virtual server settings. On the Virtual Server List page, click the virtual server that you want to change. |
| 3. | On the Virtual Server Settings page, under Virtual Server Management, click Virtual server general settings. |
| 4. | Under Maximum upload size, type the maximum file size in megabytes that you want, and then click OK. You can specify a maximum file size up to 2,047 megabytes. |
Increase the connection time-out setting
By default, the IIS connection time-out setting is 120 seconds. To increase the connection time-out setting, follow these steps:
| 1. | Click Start, point to All Programs, point to Administrative Tools, and then click Internet Information Services (IIS) Manager. |
| 2. | Right-click the virtual server that you want to configure, and then click Properties. |
| 3. | Click the Web Site tab. Under Connections, type the number of seconds that you want in the Connection time-out box, and then click OK. |
Add the executionTimeout value
| 1. | Use Notepad to open the Web.config file.
By default, this file is in the following location: Program Files\Common Files\Microsoft Shared\Web server extensions\12\TEMPLATE\LAYOUTS
|
| 2. | Add the executionTimeout value that you want. For example, replace the value as follows.
Existing code <location path="upload.aspx">
<system.web>
<httpRuntime maxRequestLength="2097151" />
</system.web>
</location>
Replacement code <location path="upload.aspx">
<system.web>
<httpRuntime executionTimeout="999999" maxRequestLength="2097151" />
</system.web>
</location>
|
| 3. | After you change the file, click Save on the File menu. |
| 4. | Use Notepad to open the Web application Web.config file. By default, this file is in the following folder:
Inetpub\wwwroot\wss\VirtualDirectories\VirtualDirectoryFolder
|
| 5. | Change the following line in the file.
Existing line <httpRuntime maxRequestLength="51200" /> Replacement line <httpRuntime executionTimeout="999999" maxRequestLength="51200" /> |
| 6. | After you change the file, click Save on the File menu. |
| 7. | Exit Notepad. |

SYMPTOMS
Back to the top





